Use psadump for backing up plesk domains

Use psadump for backing up plesk domains

Psadump is a utility that backs up all of the Plesk configuration
files, archives all of the user data on the server (including mail),
and dumps all of the databases. If possible, this should be done before
any work is started on a server with Plesk. As
the information created in this archive can be used to restore all
Plesk data, user settings, user data, databases, etc … it is a good
idea for administrators to run this every so often.

The psadump utility is located by default in /usr/local/psa/bin.
You should note that /usr/local/psa/bin is rarely if ever in any users
$PATH, so you will have to reference by it’s full location. If the
server does not have this, it can be installed either through the
graphical Plesk upgrade tool, or by installing the RPM’s located in the
PSA distribution.

The most basic command is:
/usr/local/psa/bin/psadump -f <filename with full path>
The “-f <filename with full path>” is mandatory. However, you
can, if you wish, just put the full path to the directory where you
want the dump to reside. If so, psadump will just use the standard name
for the dump (files). If only including the directory, be sure to put a
trailing slash on the end of your path.
If you want to compress the output, you can add -z thusly, which would compress the file with gzip:
/usr/local/psa/bin/psadump -z -f <filename with full path>

By default psadump stops plesk, so that no changes are made during
the process. To have psadump forgo this behavior, you can add the
—nostop option, such as below.
/usr/local/psa/bin/psadump -z —nostop -f <filename with full path>

Also, psadump will stop each domain as it is being archived, and
then start it again after it is finished. To stop this behavior, use
the —nostop-domain feature:
/usr/local/psa/bin/psadump -z —nostop —nostop-domain -f <filename with full path>

You may run into issues with psadump, as it creates one huge
archive file. This can be a problem with ext2, ext3 filesystems, as the
max file is 2GB. If you hit that limit, you can use the UNIX command of
“split” to split the backup file into smaller bits on the fly. Such a
command would look like this:
/usr/local/psa/bin/psadump —nostop —nostop-domain -f – | split -b500m – <full path to dump file>.

Lets note several things here. In the first part of the command
(before the pipe), you notice that value I gave -f is a dash. This
signifies that the output file should be standard output. We need this,
because we are piping all of this data to the command split. The split
command is using the option of -b500m, which means that each file will
be 500 megabytes in size. When 500MB is reached, it will start another
file. Also, notice the period at the end of the <full path to dump
files>. The reason for this is that split will create each dump file
with an ending of aa, ab (for the second file), ac (for the third), etc
… The period simply tells it to do so after the period. This is for
cosmetic sake, as it’s somewhat easier on the eye.
So if I were to give the following command:
/usr/local/psa/bin/psadump —nostop —nostop-domain -f – | split -b500m – /backup/psa-dump.
The following files would be created in /backup:
psa-dump.aa

psa-dump.ab

psa-dump-ac

There are several other options, and some more sophisticated backup
techniques, including only backing up certain clients, only backing up
certain domains, using psadump to store the backup file on a remote ftp
server, etc … Please check out the psadump documentation for
information and examples. The documentation for psadump on Linux Plesk
7.5 Reloaded can be found here:

http://download1.sw-soft.com/Plesk/Plesk7.5/Doc/plesk-7.5r-backup-restore-html/index.html

Leave a Reply

Your email address will not be published. Required fields are marked *

nineteen + 8 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.