How to protect against loss of server on a budget

artfulrobot asked:

I’m a small company on not much budget providing websites and databases for charity and not-for-profit clients.

I have a few Debian Linux VPS servers and ensure I have daily backups to a different VPS than the one the service is hosted on.

Recently one of my hosting companies told me two drives failed simultaneously and so that data was lost forever. Stuff happens, they said sorry, what else could they do? But it made me wonder about cost-effective ways to basically get a VPS up again in the event of a hardware or other host-related failure.

Currently I would have to

  1. Spin up a new VPS
  2. Get the last day’s backup (which includes databases, web root and website-specific config) over onto the VPS, and configure it like the last one etc.
  3. Update DNS and wait for it to propagate.

It would probably take a day or so achieve this, with the DNS propagation being a big unknown, although I have the TTL set quite low (hour or so).

Some hosts provide snapshots which can be used to replicate a set up to a new VPS, but there’s still the IP and this doesn’t help in the case that the host company cancels/suspends an account outright (I’ve been reading about this behaviour from certain hosting providers and it’s scared me! I’m not doing anything spammy/dodgy and keep a close eye on security, but I realise that they literally have the power to do this and I’m quite risk averse).

Is this, combined with choosing reputable hosts, the best I can do without going for an incredibly expensive solution?

My answer:


Small businesses with small budgets, especially nonprofits, typically are not going to be able to afford high availability. The question is, if you have virtually no budget, as is commonly the case in situations like this, what is your restore strategy?

I do have some clients like this, and this is what I do:

First, for some of them I have an incremental backup and full database dump every six hours. One client was already using CrashPlan Pro so I just used that. Whatever you do, you need to make sure you have a restorable backup.

I have a simple ansible playbook I put together in about an hour (not having previously worked with ansible) that installs nginx, php-fpm and MariaDB and prepares them to host a web site or sites. Running this playbook results in a server (or servers) that are ready to host a typical web application, and I can simply restore the nginx virtual host, application files and database to it.

The result of this is that I can bring up such a web site from backup in just a few minutes, as opposed to the manual way which could take an hour or more.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.