My server is running with thousands of domains under Plesk. To keep the copy of backups of each Domain, Clients, Resellers, Mails, Database and configuration, settings are very essential. So I have decided to write my own dedicated article to Plesk Backup and Restore Utility.
Before, we get started let us understand the basic Backup logical structure in Plesk. All backup created by Plesk is by default stored under the Plesk backup repository located on the Plesk server:
For Plesk Linux/Unix, repository location in:
/var/lib/psa/dumps/
It is also specified by the DUMP_D variable defined in the /etc/psa/psa.conf configuration file.
For example:
[root@nav1 psa]# grep DUMP_D /etc/psa/psa.conf
DUMP_D /var/lib/psa/dumps
Here, in the above output /var/lib/psa/dumps is the location of the Plesk backup dumps. If you want to you can change the location of the dumps. You can edit in the file /etc/psa/psa.conf and locate DUMP_D and give it a new location.
For Plesk Windows:
The repository is located at the default location at (“C:\ProgramFiles\Parallels\Plesk\Backupâ€).
Examples are given below:
How to Back up the whole Plesk Server
/usr/local/psa/bin/pleskbackup server -v
-v option show information about backup process
How to Backup a Single domain in Plesk with mails, hosting files, configuration and Database
/usr/local/psa/bin/pleskbackup –domains-name < yourdomain.com > –v
<yourdomain.com > replace it with your actual domain for which you want to take back up.
How to Backup only email accounts configuration and content
/usr/local/psa/bin/pleskbackup –domains-name < yourdomain.com > –only-mail -v
How to Backup only hosting configuration and content without emails
/usr/local/psa/bin/pleskbackup –domains-name < yourdomain.com > –only-hosting –v
How To Backup selected resellers . If no resellers are provided, back up all the resellers on the server.
/usr/local/psa/bin/pleskbackup –resellers-name [Reseller logins name] –v
For example:
/usr/local/psa/bin/pleskbackup –resellers-name John –v (back up all data for reseller John).
/usr/local/psa/bin/pleskbackup –resellers-name John Robin David –v (back up all data for John,Robin,David)
Usage:
pleskbackup < command > [< options >] < arguments >
Commands:
server Backs up all of Plesk.
resellers-name Backs up selected resellers. The reseller’s logins are read from command line, space-separated. If no resellers provided, backs up all resellers on the host.
resellers-id Backs up selected resellers. The reseller’s identificators are read from the command line, space-separated. If no resellers are provided, it backs up all the resellers on the host.
clients-name Backs up selected clients. Client’s logins are read from the command line, space-separated. If no clients are provided, backs up all clients on the host.
clients-id Backs up selected clients. Client’s identificators are read from command line, space-separated. If no clients provided, backs up all clients on the host.
domains-name Backs up selected domains. Domain’s names are read from command line, space-separated. If no domains provided, backs up all domains on the host.
domains-id Backs up selected domains. Domain’s identificators are read from command line, space-separated. If no domains provided, backs up all domains on the host.
Use Exclude options to exclude some resellers/clients/domains.
help Shows this help page
General options:
-f|–from-file=<file >
Read list of domains/clients/resellers from file, not from command line. File should contain list of domains/clients/resellers one per line.
-v|–verbose
Show more information about backup process. Multiple –v options increase verbosity.
-s|–split[=<size>]
Split the generated backups to the parts. Parts are numbered by appending NNN suffixes. Size may be specified in kilobytes (<nn>K), megabytes (<nn>M) and gigabytes (<nn>G). By default in bytes.’-s’ option without argument selects default split size: 2 gigabytes.
-z|–no-gzip Do not compress content files
-c|–configuration
Backup only configuration of objects, not the content.
–only-mail
Backup only mail configuration and content of selected objects.
–only-hosting
Backup only hosting configuration and content of selected objects.
–suspend
Suspend domains during backup operation.
–skip-logs Do not save log files in the backup file
–prefix=<prefix>
Backup file name prefix. Used to customize backup file name ( default is ‘backup’ ).
-d|–description=<description>
Add description to the dump
FTP options:
–ftp-login=<ftp_login>
Specify the FTP login
–ftp-password=<
ftp_password>
Specify the FTP password (used with ‘–ftp-login’)
–ftp-passive-mode
Use FTP passive mode
Exclude options:
–exclude-reseller=<obj1>,<obj2>,…
Exclude resellers from backup list.
Reseller’s logins are read from command line, comma-separated.
If no resellers provided, resellers are not backuped
–exclude-reseller-file=<file>
Exclude resellers listed in file from backup list.
File should contain list of reseller’s logins one per line.
–exclude-client= < obj1 >,<obj2>,…
Exclude clients from backup list.Client’s logins are read from command line, comma-separated.If no clients provided, clients are not backuped
–exclude-client-file= < file >
Excludes clients listed in file from backup list. File should contain list of client’s logins one per line.
–exclude-domain= < obj1 >, < obj2 >,…
Exclude domains from backup list. Domain’s names are read from command line, comma-separated. If no domains provided, domains are not backuped
–exclude-domain-file=<file>
Exclude domains listed in file from backup list.
File should contain list of domain’s names one per line.
Output files option:
–output-file=<output_file>
/fullpath/filename – regular file, — use stdout for output,
ftp://[<login>[:<password>]@]<server>/<filepath> – storing the backup to ftp server.
FTP_PASSWORD environment variable can be used for setting password.
FTP option ‘–ftp-login’ can be used for setting login.
FTP option ‘–ftp-password’ (with ‘–ftp-login’) can be used for setting password.
Used to import dump from repository into the single file.