In this tutorial, I'll guide you through the steps to change the default backup location for Plesk on your Linux server. By default, backups are stored in /var/lib/psa/dumps
. Let's change that to a new directory!
Prerequisites
- Access to your Plesk server via SSH.
- Basic knowledge of terminal commands.
Step 1: Connect to Your Plesk Server
First, connect to your server using SSH:
ssh username@$server-ip
Step 2: Create a New Directory for Backups
Now, let's create a new directory where you want to store the backups. In this example, we will use /plesk_backups
:
mkdir /plesk_backups
Step 3: Set Ownership and Permissions
Next, set the necessary ownership and permissions for the new directory:
sudo chown psaadm:psaadm /plesk_backups
sudo chmod 755 /plesk_backups
Step 4: Modify the Plesk Configuration File
4.1. Open the Configuration File
Open the Plesk configuration file in a text editor. We'll use vim
in this example:
sudo vim /etc/psa/psa.conf
4.2. Change the Backup Directory
Find the line that starts with DUMP_D
and change its value to the new directory:
# Backups directory
DUMP_D /plesk_backups
4.3. Save and Close the File
After making the change, save your edits and exit the editor.
4.4. Verify the Change
To ensure the directory has been updated correctly, run:
sudo grep -v '#' /etc/psa/psa.conf | grep -w DUMP_D
You should see:
DUMP_D /plesk_backups
Step 5: Move Existing Backup Data
Next, move all existing backup data and the hidden .discovered
directory to the new location:
sudo mv /var/lib/psa/dumps/* /plesk_backups/
sudo mv /var/lib/psa/dumps/.discovered/ /plesk_backups/
Step 6: Restart the Plesk Control Server
Finally, restart the sw-cp-server
service to apply the changes:
sudo systemctl restart sw-cp-server
Conclusion
Now all backup files will be stored in the new directory /plesk_backups
. You have successfully changed the backup location for Plesk!
Disclaimer
It's always recommended to test configuration changes in a development environment before applying them in production. For the latest documentation and guidelines, refer to the official Plesk resources. Unsure what to do? Reach out to our technical support team.