Message
Manual JMS Multisite backup/restore procedure Print

The procedure to perform a manual backup/restore depends on the platform (Windows or Linux).

The procedure consists in using a traditional Zip or tar + PHPMyAdmin export / import.
On windows platform, this is easy to zip and later unzip on your server.
On linux platform, you can tar -cvf (backup) and tar -xvf (restore)

Here we describe the procedure on a Linux with a cPanel and we assume that you have a SSH terminal available.
We also provide some usefull linux commands.

Backup the PHP Code

Change Directory
cd public_html

Show the list of files and folders
dir -l

Backup (PHP code) and Symbolic Links
tar -cvf [Deploy Dir].tar [Deploy Dir]

Compress
gzip [Deploy Dir].tar

If you want to replace the backup of the symbolic links by their content, add the "-h" parameter and also use the -z to compress the backup in one step
tar -chzf [Deploy Dir].tgz [Deploy Dir]

Move (or rename) a file
mv [Deploy Dir].tar.gz ../

Restore the PHP COde

Restore the files
Uncompress/decompress the gz
gunzip [Deploy Dir].tar.gz


Unpack (extract)
tar -xvf [Deploy Dir].tar

Print working directory (show the current path)
pwd



Check the content in the "/multisites/config_multisites.php"
Potentially delete the "master" cookies and master directory path.

Delete all the symbolic links present in each slaves sites "deployed directory".

Delete the "index.php" and "index2.php" present in the root of each "deployed directory".

Backup MySQL

You can either perform the backup of MySQL with PHPMyAdmin or an SSH command "mysqldump"


PHPMyAdmin backup = export

mysqldump --add-drop-table [DB NAME] >result.sql

Restore MySQL

You can either restore the MySQL DB using the PHPMyAdmin or with a SSH terminal  command "mysql"
Sometimes PHPMyAdmin does not allow using the restore and request that you are using a "mysql" command.

Restore from a SSH prompt
mysql -u<user name> -p<password> [DB Name] < [DB NAME].sql


mysql -u[MySQLUser Login] -p[MySQL Psw] [DB Name] < [DB NAME].sql

CRON backup script

A weekly backup script is available in the free download section.

This script can be called from a cron to perform the backup.

It is able to perform the backup of a DB and backup of a directory that can be automatically sent by FTP on another server in case of crash.

See Weekly backup script

Last Updated on Monday, 12 January 2015 15:11