"Help, my Linode VPS has died!" "Help, I've lost some data on my Linode VPS!" "Help, I stuffed up a configuration setting now my Linode VPS is bricked!" "WHAT DO I DO!?!" If you've ever uttered those words in desperation I have the answers you seek!
Having a server die, losing data or bricking your server through a wrong configuration setting are some of the most gut wrenching moments we can experience. Hopefully you've been taking nightly backups of your server at a bare minimum. Right? Right?!
Linode is a great online hosting company for cheap, reliable, Virtual Privatge Servers running linux. I have several setup for different systems I have developed and host.
The other day I found a bug in one of the SaaS systems I developed. It meant that the client data export functionality wasn't exporting dates correctly. I've no idea how this got past testing! Anyway it was a very simple fix (only had to change one character) and all was well again.
Around this time one of our client had exported their data, made some changes and wanted to import it again. With our product there are limits on how many records you can have in the system so in between exporting and importing they _purged_ their data. No biggie. Except they exported using the buggy client data export! YIKES!
Thankfully we had made the decision long ago to pony up the extra $5 a month for nightly, weekly and fortnightly backups. At $5 it was a no brainer. So much so that I didn't even really consider it again or what the process is for restoring backups.
Whilst taking solace in our decision to pay for backups I logged into the Linode Manager and did the following:
Firstly make sure your testing regime is thorough and covers all cases. I still haven't been able to figure out how this bug got through.
Secondly make sure you have backups in place and know how to restore them. The awesome thing with the Linode backup is that it takes a complete snapshot of the virtual machine. So when I restored it to the new machine it just booted up and was a fully functioning replica of production just with a data set that was a few days old. This made my job so much easier.
Finally keep a level, cool head and be prepared to think outside the square. What's the problem? What do I need to achieve? What are some options to get the desired outcome? The more options you have the less likely you are to get stuck.
In the end the whole process probably took about 2 hours, most of which was spent waiting for the new linode server to spool up and the restore to occur.
If you haven't already be sure to checkout Linode. I've been totally impressed with them over the 5 years I've been using them.
Onwards and upwards!