Categories
Development

Lets talk about backups

I think we can all agree that backups are a good thing. Wouldn’t you hate to lose those pictures you took of the beautiful sunset last weekend?

Do you keep them on your phone only, or do you load them to your computer regularly? Maybe you use an app on your phone that automatically loads them to a cloud service (googledrive, icloud, dropbox etc) as well.

If you do have that app, you are rather safe when it comes to your images.

But what about your website?

How often do you take a backup of your website? How often should you take a backup?

The answer to the first question should be the same as the answer to the second. But what determines how often you should take a backup? It’s actually rather simple, ask yourself how much data are you willing to lose if something goes wrong.

The answer to that obviously depends on what your site is about and how much it changes over time.

For blog that you occasionally write on and that rarely gets comments you can get a way with rare or irregular backups. With an active forum that have a lot of discussions going on the other hand, you would want multiple backups daily. The discussions are what is important on a forum, without them the forum is dead.

In many cases you can schedule backups to happen periodically, other times you are left to keeping track of it yourself.

Who is responsible for taking backups?

Of course, any reputable webhost would take backups. Depending on the hosting plan of choice they are not always available on a whim to the end user however. Paid plans usually have better availability of backups then free ones do.

If you host on a VPS then it is usually up to you to take backups regularly. The host is only obligated to keep backups so they can mirror the server onto new hardware in case of a hardware failure.

In both cases I’d say you should always maintain, and keep, your own backups. If for no other reason so to be able to revert back when you made a mistake, or an update failed.

I recommend that you schedule backups to be done at least weekly (depending on your site) and always before making large changes, such as upgrading a script to its latest version.

What should you have in the backups?

There are two things to consider in regards to backups.

The first thing is the files. These doesn’t change as often, usually only when upgrading the script. The exception here would be the folder(s) that receive uploads, usually for images, so doing those folders a bit more often can be a good idea.

The second, and often most important backup, is the one of your database. The database is what holds all textual data in most cases. All (most) settings and configurations of your site is also located in the database. While that would be possible to recreate, it is still a pain to lose generally.