How do I deal with failed backups? - ManageWP

Q. How do I deal with failed backups?

There are a number of reasons why a backup can fail. Don’t panic! Check the optimum server setup that we recommend. There are probably some easy tweaks that need to be made by the hosting provider in order to fix the problem.

  1. Unspecific errors (500 Internal Server Error, Empty response, Failed to zip files)
  2. Error : Sorry, we could not backup the database. Make sure mysqldump command is enabled.
  3. Insufficient write permissions
  4. Pclzip errors
  5. Failed to upload to Amazon S3
  6. Failed to upload to Dropbox / Google Drive
  7. FTP troubleshooting
  8. Exit code 14 (Disk Quota Exceeded)
  9. Exit code 137 ( Kill ( terminate immediately))

1. Unspecific errors (500 Internal Server Error, Empty response, Failed to zip files):

Note: Sometimes the backup action will be completed in the background, after the server returns an error. If this is the case, ManageWP will show the backup in the list of backups for that site when it finishes. In order to avoid this problem, ask your hosting provider to increase the timeout (for apache) or proxy_read_timeout (for nginx) to 600s.

These kind of errors most often occur when you’ve reached your server limits or when certain functions and commands are disabled on the server side. You might have a large site, but not enough server resources to handle the backup action.

You can test this issue by running only a database backup. A database backup is much smaller than a full backup, so if it works then you can be almost sure, that your problem falls under this issue.

What can you do?

  • Increase PHP Execution timePHP Memory limit and PHP version

The best way to do this is to ask your hosting provider for assistance because a lot of providers won’t let you do it yourself. You can never be sure how much will be enough but 600s PHP Execution time and a PHP Memory limit of 128MB is a good start (512MB would be the optimum value).
As the site gets bigger more resources might be needed.

Also, the PHP version should be at least 5.3.0 (5.5.0 is recommended)

  • Allow access to the zip command on your server

This is probably the most important part of your server requirements for good backup performance. Check with your hosting provider and ask them to allow these commands.

  • Enable PHP proc_open function (ManageWP’s backup tool needs this function enabled on your site server)
  • Check if the safe_mode is turned on, and turn it off
  • Try with the Less Compression option in the backup settings

This means that you will get a bigger backup file but it will require less time to perform backup. With this setting you may avoid the execution time problem.

  • Consider excluding some files or folders from your backup

By default, we include wp-admin, wp-includes and wp-content folders, and all the files within your site root folder. Have a look at your site’s folders for any unnecessary files and try excluding them from the backup file in order to reduce its size.

All the necessary functions and commands can be viewed by clicking on the site name at the website sidebar and by going into Server Information. If all the requirements are met, the Server Information window should look something like this:

If some functions and commands are missing, the best solution would be to contact your hosting provider and ask them for assistance in this matter as that will surely help.

Note: Make sure that proc_open and zip commands are added to the PATH variable and that the user running PHP can use them!

2. Sorry, we could not backup the database. Make sure mysqldump command is enabled.

The problem most probably occurs because you are not allowed to use the mysqldump command on your server.

What can you do?

  • Allow access to mysqldump command on your server (ask your hosting provider)
  • If mysqldump command is allowed and it still isn’t working, try repairing your database tables
  • Also, your database user may not have proper privileges to perform mysqldump. Try setting All privileges for your database user.

3. Permission denied, make sure you have write permission to wp-content folder:

You need the correct folder permissions to backup your site. The correct permissions will depend on your hosting company (the optimum solution for ManageWP would be 755 for folders and 644 for files). You can read more about write permissions on the WordPress Codex.

4. PclZip errors:

If the zip command is not enabled, our system will try to fallback to ZipArchive and if that is not enabled as well, we will fallback to pclZip replacement coded by our developers (pclZip takes up the memory that is equal to the size of your website backup archive).

If you get a pclZip error, the best solution is to refer to the first item of this topic related to the server limits problem and how to optimize backup performance. Try asking your hosting provider to allow access to the zip command on your server.

5. Amazon S3 Troubleshooting:

Here are a few quick tips:

  • Check if the bucket you entered exists
  • Make sure the specified bucket region corresponds to the region in your S3 Account
  • Check if there is enough available space at your Amazon S3 account

If none of that applies, please reset your secret access key and try entering the details again.

6. Dropbox and Google Drive troubleshooting

Could be that there is just a temporary interruption in the communication. Try re-connecting your Dropbox and Google Drive accounts by hovering over your username at the top right corner of your ManageWP Dashboard and by going into Settings > Linked Services.

It is also best practice to re-save your backup tasks after you re-connect your Dropbox and Google Drive account, this way ManageWP will send the updated information to your websites and your backups shouldn’t have problems with uploading to Dropbox and Google Drive account.

7. FTP troubleshooting

Here are a few quick tips :

  • click on Test connection button to check whether ManageWP can connect to the FTP server
  • check credentials by using them to connect to site FTP through FileZilla or some other FTP client
  • try to uncheck Use passive mode box
  • check whether you have entered a correct remote destination path ( folder in which you wish to save backups )
  • check whether you have entered the correct port ( usually FTP connection goes through port 21)

8. Exit code 14 (Disk quota exceeded)

The exit code 14 : Disk quota exceeded zip error indicates that the memory allocated for this website has been exceeded.

If you are receiving this error, please check what is the status of free space on your site server.

9. Exit code 137 (Kill (terminate immediately))

This error indicates that the backup script has been terminated by a server side process. Please contact your hosting provider and check with them what process that might be, and whether it could be adjusted in such a way that our script would continue running uninterrupted.

The process that kills our backup script might be a server timeout, so this could be the first question you could ask the hosting provider to check.

For more information, check out the following page that covers Site Server Timeouts.