Monday, October 23, 2006

Server Backup Strategy

For those of you out there who administer your own dedicated servers, having a good backup strategy is critical.

Since I wanted total control of the servers, I chose the more affordable package that leaves me solely responsible for maintaining my boxes. This can be a blessing (more flexibility) and a curse (more work). With my Unix background, I felt pretty comfortable taking on the task of admining the boxes myself, but I will add that I don't think it is for everyone. There is a lot of overhead in maintaining the servers yourself. You are resonsible for patches, security updates and designing your own backup plan (or pay for one). If something goes wrong, you will be the one restoring it. The host will help if you need it, for a cost...=)

My current setup consists of a pair of leased dedicated servers. With this scenario I found the ideal (and most affordable) solution was to have each server act as a backup to the other.

My first step was to create a few cron jobs to back my database(s) and file system up. Once I had those zip files, I then had a job that would remotely SSH to the other box, and tranfer all the files via SFTP (secure FTP). The second server would in turn do the same.

My current setup has jobs that run nightly doing full backups for a running 7-day window. This gives me the ability to go back to any previous day from the last week at any given time if needed. Next I have a weekly job that creates time-date stamped backups. These are more permanent backups for archiving. So if I need to go back more than a week, I can resort to any of my weekly backups. Monthly I download the backups from each server to an external drive in my home office.

Another facet of my plan is the location of each of my servers. My ISP offers the option to choose which data center you would like your server hosted in. They offered 3 locations in North America. This allowed me to have one server in midwest Canada and one on the US east coast. This may seem a bit extreme to some, but I've seen ISP's lose power in a particular data center from time to time. Having my boxes spread over mulitple data centers helps me avoid a total shutdown of my site(s). In a worst-case scenario, I could have my sites from server A back up and running on server B in a few hours if needed, since they both maintain recent backup files from the other.

Then of course the ultimate worst-case is if both sites go down. That's when I go to my local backup and start running the sites from my home PC... just like the old days... ;-)

No comments: