2. Change into a directory were you would like the backup of Plesk to be saved. In this example I have made a directory called backup and changed into this directory
# mkdir home/backup
# cd home/backup/
3. Type the following the command to start the Plesk backup procedure. This would make a complete backup (-F), to the directory location /home/backup (-f)
# /usr/local/psa/bin/psadump -F -f /home/backup/
You will see the messages that the backup is in progress. After you will see the message
“Server backup is successfully completed”
4. After the backup is complete you can check the archive file which looks similar to;
1 root root 7568786 Oct 11 12:14 psa-7.1.4-p15160828.pureserver.info-20041011.12.archive
You may now save this file to another server via FTP if you wish.
NOTE: A ftp backup of Plesk can also be done using the following format
: @ storing the backup file on remote ftp server.
5. To restore the backup you would need to change back into the home/backup directory and run the following command
/usr/local/psa/bin/psarestore -f psa-7.1.4-p15160828.pureserver.info-20041011.12.archive -m map_ip -s shell_ma
NOTE:
The restore backup might fail on the 1st run. The reason for this is Plesk looks for the map_ip and shell_map files which may not be located, so on the first run it creates the files. If you run the restore command again the procedure would now start to restore Plesk on the system. If you do not get the following message then run the command again for the third time;
“Server restoration is completed”
You can also review the psadump and psarestore logs located at /var/log/ on the server.
Additional options that can be used for making the backup
Options:
* -h – This help.
* -F – Make (f)ull dump(it is default option, -C option is not supported now).
* -z – Enable gzip compression for result dump file.
* -f
* /fullpath/filename – regular file,
* /fullpath/ – dir for dumpfile with default name,
* – – use stdout for output,
* : @
I prefer not to do it this way because the file is too large, making a daily backup very tedious. Most importantly, you cannot roll back your plesk server to an earlier version this way unless you keep the old backup as well. It is a matter of preference and the users ability.
I recomend tar’ing your backups separately.
Create Cron jobs that back up each of the following directory’s
/boot: Files important for boot process
/etc: System configuration files
/home: Domains and home directories of users
/root: Homedirectory of root
/var/lib/mysql: MySQL-Databases
/var/logs: Log-files
/var/spool/mail: User-mailboxes
/var/spool/cron: Cron-Jobs
/usr/lib/python2.1/site-packages: PLESK Configuration
Here is an example:
15 1 * * * tar czvf /home/backup/sql.tar.gz /var/lib/mysql
This will run at 1:15am everyday of every week and of every month and back up the /var/lib/mysql directory naming it sql.tar.gz and storing it in the /home/backup directory.
I store my backups in a newly created directory under my home directory because of space. *Please note*: if you do the same, you must not backup the whole /home directory because if you do you will create an infinite loop, backing up your backup, over and over.
I also recomend you backup domains individually so you are not stuck with a huge tar file. Restoration depends on how fast you can upload your data and set-up the server, that is why I choose the later because I can easily reconfigure plesk and individually upload the tars 10 times faster then uploading a 2 gig file that takes a long time to execute.
# /usr/local/psa/bin/psadump -F -f /home/backup/
You will see the messages that the backup is in progress. After you will see the message
“Server backup is successfully completed”
4. After the backup is complete you can check the archive file which looks similar to;
1 root root 7568786 Oct 11 12:14 psa-7.1.4-p15160828.pureserver.info-20041011.12.archive
You may now save this file to another server via FTP if you wish.
NOTE: A ftp backup of Plesk can also be done using the following format
: @ storing the backup file on remote ftp server.
5. To restore the backup you would need to change back into the home/backup directory and run the following command
/usr/local/psa/bin/psarestore -f psa-7.1.4-p15160828.pureserver.info-20041011.12.archive -m map_ip -s shell_ma
NOTE:
The restore backup might fail on the 1st run. The reason for this is Plesk looks for the map_ip and shell_map files which may not be located, so on the first run it creates the files. If you run the restore command again the procedure would now start to restore Plesk on the system. If you do not get the following message then run the command again for the third time;
“Server restoration is completed”
You can also review the psadump and psarestore logs located at /var/log/ on the server.
Additional options that can be used for making the backup
Options:
* -h – This help.
* -F – Make (f)ull dump(it is default option, -C option is not supported now).
* -z – Enable gzip compression for result dump file.
* -f
* /fullpath/filename – regular file,
* /fullpath/ – dir for dumpfile with default name,
* – – use stdout for output,
* : @
I prefer not to do it this way because the file is too large, making a daily backup very tedious. Most importantly, you cannot roll back your plesk server to an earlier version this way unless you keep the old backup as well. It is a matter of preference and the users ability.
I recomend tar’ing your backups separately.
Create Cron jobs that back up each of the following directory’s
/boot: Files important for boot process
/etc: System configuration files
/home: Domains and home directories of users
/root: Homedirectory of root
/var/lib/mysql: MySQL-Databases
/var/logs: Log-files
/var/spool/mail: User-mailboxes
/var/spool/cron: Cron-Jobs
/usr/lib/python2.1/site-packages: PLESK Configuration
Here is an example:
15 1 * * * tar czvf /home/backup/sql.tar.gz /var/lib/mysql
This will run at 1:15am everyday of every week and of every month and back up the /var/lib/mysql directory naming it sql.tar.gz and storing it in the /home/backup directory.
I store my backups in a newly created directory under my home directory because of space. *Please note*: if you do the same, you must not backup the whole /home directory because if you do you will create an infinite loop, backing up your backup, over and over.
I also recomend you backup domains individually so you are not stuck with a huge tar file. Restoration depends on how fast you can upload your data and set-up the server, that is why I choose the later because I can easily reconfigure plesk and individually upload the tars 10 times faster then uploading a 2 gig file that takes a long time to execute.
0 comments:
Post a Comment