How to copy your Saurus CMS website

Moving or copying your website between the different servers or inside one server is quite simple process - this article will give you some general guidelines.

Having SSH access

1. Source site: Go to your website root directory and pack all files

$ tar -czpvf ../web_scripts.tgz * .htaccess  

NB! it is common mistake not to include the file ".htaccess" into the package.

2. Source site: Create MySQL database dump

$ mysqldump -u username -p --opt  database > web_db.dump

3. Move files "web_scripts.tgz" and "web_db.dump" to the target directory

4. Target site: Unpack files

$ tar -zxpvf web_scripts.tgz -C /your/website/root/directory/

5. Target site: Import MySQL data into the new database

$ mysql -u username -p new_database < web_db.dump

6. Target site: Cleanup template's temporary files

$ rm -rf classes/smarty/templates_c/*

7. Check permissions - be sure that the following upload directories have write permissions on the web  server:

public/ - files used for content management 
shared/ - files used for content management
classes/smarty/templates - Saurus API templates
classes/smarty/templates_c - Saurus API compiled templates code
classes/smarty/cache - Saurus API templates cache

8. Only for versions older than 4.6.0 Replace absolute path of the website folder:

Execute following SQL in target site (enter correct path values before):

UPDATE obj_folder SET fullpath = REPLACE(fullpath, '/old-asbolute-path/', '/new-absolute-path/');
UPDATE obj_file SET fullpath = REPLACE(fullpath, '/old-asbolute-path/', '/new-absolute-path/');

Having FTP access and phpMyAdmin

1. Source site: Copy all files from the website root directory to the destination directory.

NB! it is common mistake not to include the file ".htaccess" into the package.

2. Source site: Create MySQL database dump using phpMyAdmin.

3. Destination site: Import MySQL data into the new database using phpMyAdmin.

4. Cleanup template's temporary files. Delete all files in the directory "classes/smarty/templates_c".

5. Check permissions - be sure that the following upload directories have write permissions on the web  server :

public/ - files used for content management
shared/ - files used for content management
classes/smarty/templates - Saurus API templates
classes/smarty/templates_c - Saurus API compiled templates code
classes/smarty/cache - Saurus API templates cache

6. Only for version older than 4.6.0: Replace absolute path of the website folder:

Execute following SQL in target site (enter correct path values before):

UPDATE obj_folder SET fullpath = REPLACE(fullpath, '/old-asbolute-path/', '/new-absolute-path/');
UPDATE obj_file SET fullpath = REPLACE(fullpath, '/old-asbolute-path/', '/new-absolute-path/');