On a server I have to administrate, I had some problems to set up the Backup Manager through the Plesk Panel. So I decided to write a small tutorial on how to set up the Backup Manager on a 1&1 Dedicated Server Linux. But it might the the same on many other servers as well.
The 1&1 Server uses Plesk version 9.2. The first step is to logon to the Plesk Panel. On the „Home“ page you should find a button for the Backup Manager in the Server section:
After selecting the Backup Manager you will see some tools. The „Refresh“ function is self-explanatory. But I will give you a quick overview over the other tools.
With the tool „Back up“ you can create a single Backup which will be executed immediately. The „Scheduled Backup Settings“ option allows you to set up a daily (or a weekly, monthly) backup. The „Upload Files to Server Repository“ option is used to copy backups back to the server to use them for recovery. But we first take a look at the „Personal FTP Repository Settings“ option:
In this form you have to enter the login data from your 1&1 Recovery Server. You’ll find these information in the 1&1 Control-Center in the „Server-Backup“ option in the „Server-Verwaltung“ (server management) section. You might not be able to access this FTP server from your local machine, so don’t mind that. The access to the FTP server from your web server will work thorugh the 1&1 network. After entering the data and saving the settings with a click on „OK“ you will get back to the „Backup-Manager“ menu. Here you choose „Scheduled Backup Settings“:
It’s very important to choose „Personal FTP repository“ to save the data on the FTP backup server so your backups don’t get lost if your 1&1 ROOT server crashes. It depends on you when to start the backup but you should choose a time if less visitors. So if your server is in europe but you have many visitors from the US, 1am isn’t a good time as. In this case you should choose something like 6am where users from the US go to sleep and europeans just get up. The process doesn’t need a lot of ressources but choosing the right time, you get a backup with the data of a whole „day“. You can also set a prefix if you like to. But you should enter an e-mail address to get messages about failed backups. At last you must choose the „Server configuration and content“ because otherwise you wouldn’t backup the files on your server.
UPDATE: You should also consider to limit the number of backups to a reasonable value. Why this is important you can read in this post: Limit the number of backups in the Plesk backup manager.
Now it seems like we are done. But unfortunately we are not. The default setting of Plesk will save the backups in the „/var/lib/psa/dumps“ folder which is located on the „/dev/sda6“ partition. This partition is often too small for a backup file. The backup is stored in this folder before it will be moved to the FTP server after completing the backup process. As the MySQL tables are also stored on this partition, you’ll get in real trouble as soon as the backup fills up the whole partition. The MySQL databases will then have no space left to create temporary tables for thier queries and this will cause the MySQL server to deny huge queries. So you have to move the backup folder. You should move it to the largest partition on your disk. To find out which one is the largest, you can use the „df“ command (the addidtional paramerters are only for visibility), after you logged on using SSH:
s12345678:~ # df -h -x tmpfs Filesystem Size Used Avail Use% Mounted on /dev/sda1 9.2G 235M 8.5G 3% / /dev/sda5 9.4G 2.2G 7.3G 23% /usr /dev/sda6 9.4G 1.9G 7.5G 20% /var /dev/sda7 436G 21G 416G 5% /srv
In this example the largest partition ist „/dev/sda7“ on which the „/srv“ folder is mounted. You move the folder using this three commands:
mv /var/lib/psa/dumps /srv/dumps rm -rf /var/lib/psa/dumps ln -s /srv/dumps /var/lib/psa/dumps
The first command moves the folder to „/srv“ which is in this example on the largest partition because the webspace files are also in this folder. The second command deletes the folder on it’s old place (if it’s still there). The most important one is the third command. It creates a so-called „symbolic link“ to the new folder. Using this symbolic link, you don’t have to change the plesk config which isn’t possible trough the Plesk Panel anyways.
After this steps you just have to wait until your first backup time is reached. The backup process may take half and hour or even more. To test your settings you may simply create a single backup with the configuration only using the „Back up“ option. After the backup has been created sucessfully you should be able to see them listed on the „Personal FTP Repository“ tab:
On this tab you can also use a backup for recovery. But thankfully I didn’t need to do that, yet. But as soon as I had to do that (hopefully never) I will post about it.
I hope this post could have helped you on setting up a backup routine. But it’s a pity that 1&1 doesn’t configure their servers correctly and choose the largest partition for the backup data. If you have another tip to this topic or if you have any questions or suggestions I would be happy about some comments.