Changing Plesk’s backup location in Linux

By default all backup data is stored in the directory /var/lib/psa/dumps .

To change the default backup location connect to the Plesk server via SSH and modify the backup location in the Plesk configuration file /etc/psa/psa.conf by changing the value of DUMP_D.

First we need to mount the backup volume allocated to our new Ubuntu Plesk 17.8 on 18.04 droplet with Digital Ocean:

# Create a mount point for your volume:
$ mkdir -p /mnt/volume_lon1_03

# Mount your volume at the newly-created mount point:
$ mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_volume-lon1-03 /mnt/volume_lon1_03

# Change fstab so the volume will be mounted after a reboot
$ echo '/dev/disk/by-id/scsi-0DO_Volume_volume-lon1-03 /mnt/volume_lon1_03 ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab

Next edit the psa.conf file:

$ nano /etc/psa/psa.conf

Find the backups directory variable:

# Backups directory
DUMP_D /var/lib/psa/dumps
# Backups temporary directory. DUMP_TMP_D should not be inside of (or equal to) DUMP_D.
DUMP_TMP_D /tmp

and update:

# Backups directory
DUMP_D /mnt/volume_lon1_03
# Backups temporary directory. DUMP_TMP_D should not be inside of (or equal to) DUMP_D.
DUMP_TMP_D /tmp

Save the file and verify that the directory has been changed:

$ cat /etc/psa/psa.conf | grep -w DUMP_D
DUMP_D /mnt/volume-lon1-03

If this isn’t a new droplet, move all previous backup data from the old location to the new:

$ mv /var/lib/psa/dumps/* /mnt/volume_lon1_03/
$ mv /var/lib/psa/dumps/.discovered/ /mnt/volume_lon1_03/

Restart the sw-cp-server  service:

$ service sw-cp-server restart

Note, sometimes is is necessary to change ownership of a new backup directory, for example:

$ mkdir /pleskBKS
$ chown psaadm:psaadm /pleskBKS

You May Also Like