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.
echo "description goes here" > description.txt
Run the backup:
/usr/local/psa/admin/bin/domain_bu --backup --domain-name $DOMAIN_NAME --dump-file $DOMAIN_NAME.domain_dump --desc-file description.txt
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):
tail -f backup_restore.log
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:
/usr/local/psa/admin/bin/domain_bu --restore --domain-name $DOMAIN_NAME --client-login $CLIENT_LOGIN --domain-ip $IP_ADDRESS --dump-file $DOMAIN_NAME.domain_dump
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):
RewriteRule (.*) http://domain.com.previewhostname/$1 [P]
where domain.com.previewhostname would be where the site can be viewed before dns is changed.