Applicable to:
- Plesk for Linux
Question
How to change the location for Plesk backup files in Linux?
Answer
By default, all backup data is stored in the directory /var/lib/psa/dumps
.
To change the default backup location, follow these steps:
-
Connect to a Plesk server via SSH.
-
Create a new directory for backups. In these example, we are using
/plesk_backups
:# mkdir /plesk_backups
-
Set necessary ownership for the created directory:
# chown psaadm:psaadm /plesk_backups
# chmod 750 /plesk_backups -
Modify the backup location in the Plesk configuration file
/etc/psa/psa.conf
:4.1. Open the file
/etc/psa/psa.conf
in a text editor. In this example, we are using the vi editor:# vi /etc/psa/psa.conf
4.2. Change the value of DUMP_D to the created directory from step 2:
CONFIG_TEXT: # Backups directory
DUMP_D /plesk_backups4.3. Save the changes and close the file.
4.4. Verify that the directory has been changed:
# grep -v '#' /etc/psa/psa.conf | grep -w DUMP_D
DUMP_D /plesk_backups -
Move all backup data and the hidden .discovered directory from the old location to new:
# mv /var/lib/psa/dumps/* /plesk_backups/
# mv /var/lib/psa/dumps/.discovered/ /plesk_backups/ -
Restart the "sw-cp-server" service:
# service sw-cp-server restart
Now all backup files will be stored in the directory/plesk_backups
.
Additional Information
To change the location for temporary backup files, visit this KB article.
Comments
13 comments
Hello,
1. could you please tell me where is located plesk backup script. I would like to change it a little.
2. Will it be exchanged if plesk will be upgraded anytime?
Thanks a lot.
Hello @Starvos,
This is unexpected behavior. A deeper investigation is required.
Please, submit a support request to us or to our partner, in case, the license was purchased from them.
Hello
I think a permission of 755 is to much, regarding the 'plesk repair' utility:
Hi, i have changed that Backup Location and Backup works but Plesk Fails to Upgrade/ Update...
Some Errors:
"chown: changing ownership of '/mnt/dumps-box2/mysql.preupgrade.17.5.3-17.5.3.20180424-092657.dump.gz': Permission denied"
"*** problem report ***
ERROR while trying to backup MySQL database
Check the error reason(see log file: /var/log/plesk/install/plesk_17.5.3_installation.log), fix and try again"
I already chown psaadm and double checked that with new Location.
@Francisco Gochez it is quiet strange - it should not be reverted back by Plesk, please create ticket to our support.
Hello,
I have set up DUMP_D and DUMP_TMP_D for not standard folder (mounted disk on cloud service), and the backup creation process works well. But when I download backup file from remote ftp storage, the file is downloaded to /opt/psa/tmp/ (instead of DUMP_TMP_D), and then, after it is downloaded, it is moved to DUMP_D. When there is not enough free space on the base partition (where /opt/psa/tmp is) i can't download the backup or restore a backup from remote ftp storage. (My backup files are big proportionally to partition size).
In my opinin the file should be downloaded to DUMP_TMP_D.
Please tell me if there is an option to change location of temporary download file or, if there is any other workaround of this problem with small base partition.
Plesk 17.8.11 Update #62, Debian 8.11.
Best regards,
Hello, I have changed successfully two times the default backup location but it reverts back after a few days. When backups are stored on the boot disk it has 1-2% space left. I need it in another disk permanently. How do I prevent from rolling back this change?
Hello @Stanisław Daszkiewicz,
Thank you for your question.
To change and configure the default location for temporary backup files, please check the following article: How to change default location for temporary backup files
Hello,
i have changed the backup location to a mounted cifs volume, the backup process completes with no errors but appears in the panel as several backups with the same datetime
@Lenor
Hi, you can check workaround from https://support.plesk.com/hc/en-us/articles/213949225-Plesk-update-or-upgrade-failed-ERROR-while-trying-to-backup-MySQL-database article.
Hi there Kris Lowet
Thanks for noticing this!
We've updated the article.
@Michael M.,
1) The script is located at /usr/local/psa/bin/pleskbackup
However, I have to notice, that such customization will not be supported. I suggest keeping a backup of the script in case something goes wrong.
2) A custom script will be replaced during Plesk update in case it was changed by Plesk developers. And it will be always replaced in case of Plesk upgrade.
Hello,
In "/etc/psa/psa.conf" file, there is no line about # Backups directory.
There are only three lines in this file which are # Plesk tree, # Directory of SysV-like Plesk initscripts, # Directory for config files
Is there any other locate the change DUMP_D?
Please sign in to leave a comment.