How much free disk space do I need to create a backup?

This question is only interesting or relevant if a) you do not have an “unlimited” hosting plan and b) you are already using more than (approximately) 25% of your web hosting plan’s web space.

The very short answer is: theoretically, up to two-thirds (i.e. twice as much free space available as is already used); though most users will require less than this. This answer is not something unique to UpdraftPlus, but is the case for backup plugins generally, if they are based on WordPress on a modern web hosting platform. If your site is large (e.g. over 250Mb), then you can significantly reduce the amount of free space needed by going into the ‘expert’ section at the bottom of the ‘Settings’ tab, and reducing the ‘split’ setting down from its default (of 500Mb) to something less (e.g. 100Mb).

Longer answer

Here is a longer explanation to help you evaluate your particular case and give more technical details:

If you are dispatching your backups to the cloud (e.g. Amazon S3, Google Drive, Dropbox, Rackspace, FTP, WebDAV), then some space is still needed within your web hosting account to create the backup, before it is then sent off to the cloud.

Backups are created as zip archives, which are compressed. So it’s not possible to predict exactly how much will be needed (because some resources can be compressed more than others). It will never be more than your existing usage. The larger your site is, the more likely it is that most of your space is used by already-compressed resources (e.g. graphics, videos, audio), and the closer the amounts for “needed space for backup” to “spaced used by your website” will be. For small sites, with few uploaded resources, the ratios will be much less – since much of your usage will be for WordPress itself, which isn’t normally backed up (since you can get another one from wordpress.org), and which even if you are backing it up is mostly easy to compress.

However, there is another factor involved. UpdraftPlus, being written in the PHP programming language (as is WordPress itself), uses PHP’s facilities for creating zip files. When creating a zip file, PHP can internally create a temporary zip file, which can be as large as the resulting zip itself. As a result, it’s mathematically possible, if you back up everything, to need at least two-thirds / 67% free space in your web hosting account in order to produce a backup. (One third is used by your site; another third is used temporarily by PHP in producing the zip file that UpdraftPlus requests of it; and another third is used by the zip file itself).

If your web hosting setup lacks resources, then it is furthermore possible for some of these temporary files to be left behind. If your web hosting server, in order to manage resources, kills off the PHP process before it finishes, then the temporary file will remain until is cleared up manually by UpdraftPlus, once the archive is completely created, or if that happens then usually 12 hours later. This can really boost the amount of disk space you need for things to complete successfully, especially if it happens multiple times. If you have a resource-limited web hosting provider, plus a small disk space allowance, then that’s an unpleasant combination. Unfortunately the PHP engine does not advise its users (in this case, UpdraftPlus) as to where it put its temporary files, so UpdraftPlus just has to do its best to clear up what it can find, after the event. However, UpdraftPlus by default splits zip data every 500Mb, and cleans up temporary files each time a new split occurs. So, you can reduce the amount of space taken up by temporary files (and the likelihood of PHP leaving them behind when it dies) by reducing this setting (in the ‘expert’ section at the bottom of the ‘Settings’ tab).

If you are not dispatching your backups to the cloud (why not? Are you expecting any hackers to be so kind as to not touch your backups, or your hosting company never to go bust or have an accident?), or if you are leaving backups behind on the server (i.e. if you changed the Expert Option for this), then you will of course need further resources, for each backup set that remains on the server.

Posted in: Backing up, Troubleshooting

twitterlinkedinFacebook