Page 1 of 1
Difficulty restoring from backup
Posted: Sat Oct 20, 2012 5:03 am
by firebird
Migrating from old host ISP to new.
Have backup of site, both the full document root and a MySQL export.
On new hosting account, downloaded and installed current version of CMSMS (1.11.2). Install worked perfectly.
Unzipped backup overtop of new installation.
Attempted to import sql backup, but receiving message:
import.php: Missing parameter: import_type
import.php: Missing parameter: format
Found and deleted these lines from top of file:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
but same errors continue.
Also, trying to run anything after unzipping old backup overtop new install results in:
Fatal error: Call to undefined function cmsms() in /home/username/public_html/plugins/function.cms_stylesheet.php on line 30
Attempting to re-run install, results in:
Fatal error: Call to undefined function lang() in /home/username/public_html/lib/test.functions.php on line 128
Any thoughts or suggestions?
Re: Difficulty restoring from backup
Posted: Sat Oct 20, 2012 12:29 pm
by Jo Morg
firebird wrote:On new hosting account, downloaded and installed current version of CMSMS (1.11.2). Install worked perfectly.
Unzipped backup overtop of new installation.
Should be the other way around. It seems that old site has a different version of CMSMS. So import DB, unzip backup, run install (or upgrade depending on versions). If install make sure you don't overwrite the DB: IN STEP 5 DON'T CREATE TABLE OR INSTALL DEFAULT CONTENT.
Also, compare PHP and MySQL versions on both servers and try to export the Database with some different settings. The DB must be imported without errors.
Re: Difficulty restoring from backup
Posted: Sat Oct 20, 2012 12:51 pm
by Jos
Or maybe this might help.
http://docs.cmsmadesimple.org/moving
I agree with JoMorg that it is simpler to run the install script (and NOT create tables) in stead of editing the config file as described in step 4.
Re: Difficulty restoring from backup
Posted: Sat Oct 20, 2012 1:06 pm
by Jo Morg
Heh! Will take me a while to get used to the fact that CMSMS have updated DOCs!

Re: Difficulty restoring from backup
Posted: Mon Oct 22, 2012 8:37 pm
by firebird
Importing db backup from shell cli, as suggested. Command line:
mysql -u mysite_myuser -h localhost -p mysite_mydb < dump.sql
Import aborts at line 2210 (40103 SET TIME_ZONE etc...) Below is remainder of file. Should I just delete all that? Is it possible that the import worked even if those last 13 lines failed? (first LOCK TABLES line is number 2205)
LOCK TABLES `cms_version` WRITE;
/*!40000 ALTER TABLE `cms_version` DISABLE KEYS */;
INSERT INTO `cms_version` VALUES (32);
/*!40000 ALTER TABLE `cms_version` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2012-10-15 5:01:22
I also downloaded the same CMSMS version as the site had: ver 1.6.6 -- and unzipped it into a folder called zzz (so that unzipping would not overwrite the existing folders (admin, tmp, modules, etc) created by unzipping the site backup).
I attempted to run install from in there, as:
http://mysite.com/zzz/install/index.php
but it wanted to install itself into the zzz folder, which was not what I thought should happen. It should install into public_html, yes?
I therefore copied the entire "install" folder out of zzz and into public_html, and tried to run:
http://mysite.com/install/index.php
At least I saw the correct first screen (language selection) but it abended on the second screen with this error:
Fatal error: Call to a member function GetRow() on a non-object in /home/frbrd69/public_html/lib/classes/class.contentoperations.inc.php on line 843
Thoughts / ideas?
By the way, before trying to run install I had edited config.php and corrected the path differences. (Although I am a complete novice with CMSMS, I am comfortable with PHP programming at an intermediate level.)
Re: Difficulty restoring from backup
Posted: Wed Oct 24, 2012 9:07 pm
by Jo Morg
firebird wrote:I also downloaded the same CMSMS version as the site had: ver 1.6.6...
You won't get much help with that version of CMSMS.
My suggestion is:
a) Check the
minimum requirements of the latest CMSMS version;
b) Check if your old host meets those requirements;
c) If it does,
update to the latest if possible;
d) move from one host to the other;
It seems to me that there are a few differences of servers software (PHP and mySQL) versions between both hosts. If that is the case you'll have to find a platform were import's and exports may eventually be compatible.
HTH
Re: Difficulty restoring from backup
Posted: Thu Oct 25, 2012 2:15 am
by firebird
Thank you, Jo Morg, for standing by with this process.
Here's what finally got it to work:
1. Create user account on web host
2. Create database
3. Create admin user for database
4. Add user to the database, give all permissions
5. Get to cli (recommended: PuTTY) and enter import command as per migration docs:
mysql -u username_admin -h localhost -p username_dbname < localhost.sql
(where localhost.sql is the name of the mysql dump file)
6. Download same cmsms version as was on old site
7. unzip this version into public_html (or the web root)
8. CHMOD the following folders and files 777
- tmp
- modules
- uploads
- tmp/all folders
- uploads/images folder
9. create an empty file and call it config.php. CHMOD it 777
10. "
http://yourwebsite.com/install/index.php
11. unzip the original site's web root backup zip file, overwriting everything the install created
All now working as it was before. However, with this old version of CMSMS we're still hooped with the PHP incompatibilities (new server has PHP 5.3+).
I'll create a new topic for this next challenge.