30 Nov
Posted by: admin in: Linux/Plesk
This HOWTO shows how to use the Plesk command line utilties to backup and restore a single domain. This can be useful, among other reasons, as a way to move a site between servers (though now they have the Migration Manager for that) or as a way to make a final backup of a domain before removing it (though to be safe you should make other backups and have regular periodic backups as well).
Set a domain name as a variable in your shell (not really required, just makes the rest harder to screw up if you copy and paste from this howto):
Go to the directory where plesk keeps the dumps
Create a file with the description. even if you don’t care about the description, the file needs to exist.
Run the backup:
Note that the shell prompt will be returned to you before the backup is completd. you can watch for the backup to be finished with this command (after waiting a moment or two for backup_restore.log to be created if it wasn’t there already):
When you see the text “Single domain backup is successfully completed.” (or something to that effect, depending on your version), the backup is completed.
To restore again with the backup, or restore on another server:
- Add the domain under the desired client in plesk (the domain has to exist in plesk to continue).
- Copy the .dump file to other server’s /var/lib/psa/dumps/[DOMAIN_NAME] directory.
- Set a domain name, client login and ip address the site should use as variables in your shell (not really required, just makes the rest harder to screw up if you copy and paste from this howto):
Go to the dumps directory where you had copied the dump to
Run the restore command:
If you get errors when restoring related to unmatched cert, see the instructions here: http://forum.plesk.com/showthread.php?s=&threadid=12274
If this backup/restore was to move a domain to a new server, here are some useful tips:
- Set the TTL for the zone to something low like 600 more than a day in advance.
- After the move, you can add something like this to the .htaccess file of the site on the old server (for web requests that still make it there):
where domain.com.previewhostname would be where the site can be viewed before dns is changed.
Leave a reply