October 27, 2009

Restore a single domain in Plesk 9.2.1 (Linux)

If you have correctly configured your Plesk backups, using the ‘pleskbackup’ command line utility then single domain restores don’t have to be complicated!

Note that this outline expects that you have a pleskbackup script similar to the following in place at /etc/cron.daily/z-plesk-backup:

echo Plesk Nightly Backup
echo
/bin/mv /psabu/dump6 /psabu/dump7
/bin/mv /psabu/dump5 /psabu/dump6
/bin/mv /psabu/dump4 /psabu/dump5
/bin/mv /psabu/dump3 /psabu/dump4
/bin/mv /psabu/dump2 /psabu/dump3
/bin/mv /psabu/dump1 /psabu/dump2
/usr/local/psa/bin/pleskbackup server --output-file=/psabu/dump1
echo
echo Backup File Sizes:
echo
/usr/bin/du -csh /psabu/dump*
echo
echo Backup Complete!

Restore Process

1. Make sure the domain you need to restore is not listed in the “Domains” list in Plesk.

2. Login to your server and change directories to the backup file directory (in the above script ‘/psabu/’).

3. Create a backup map file, this is necessary in order for the restore process to identify resource locations such as IP addresses and MySQL databases.

/usr/local/psa/bin/pleskrestore --create-map dump1 -map dump1map

4. Review the dump1map file to confirm your domain is listed. If its not, chances are high that your domain isn’t included in the backup dump and you’ll need to check another dump file from a previous day.

5. Complete the restore of your domain:

/usr/local/psa/bin/pleskrestore --restore dump1 -level domains -filter list:your.domain.net -map dump1map

Where “your.domain.net” is the domain you need to restore.

Note: This will take up to 30 minutes, varying on the size of the domain being restored.

6. Once the restore is complete, login to Plesk and confirm the domain is present.

For more pleskrestore options click here.