12.21
Backing up my server has been something I’ve been meaning to do for awhile. I currently host websites and tools for over 5 different people and groups, losing all their data would not be a good thing. The complete data loss of Coding Horror and the Stack Overflow Blog were major wakeup calls for me. Luckily they have been able to restore most of their data through their community, something which I’m afraid I can’t do. So on a quiet Monday morning with nothing to do (School is closed due to snow), I decided to finally make a backup.
My master plan for this is downloading important data off vps1 and vps2, including home folder, /srv/http, and configuration files, through SFTP/SCP using FileZilla. I’ll then store them on my currently unused external hard drive, along with a copy on my computer. Seems easy enough.
Downloading everything file-by-file through SFTP though wasn’t as easy and quick as I thought though. I wish I was aware that git repositories had so many folders, but I guess it made sense. The discovery was made while I sat and watched FileZilla going through each and every folder looking for files, until it hit a dead-end, which it then turned around and looked through the next one. This wouldn’t work.
For speed and bandwidth I decided to pack everything in tars and then download. I opened up PuTTY Tray, connected to the server, and one by one, I packed folder. Here’s the command.
tar cvzf <filename>.tar <folder>
This turned out to be a much better solution, and downloads could get a much better speed then they were before. Once all the tars were downloaded I just ctrl/shift-click selected them, and used WinRAR’s explorer integration’s Extract Here command to populate the folders.
Great, now that I have all the files off the servers, there’s just one thing left, and that’s MySQL. As I’m heading into this task, my plan is downloading each DB one by one using HeidiSQL (A very good MySQL GUI client). On vps1, all the DBs on there total to about 32MB. Not very much.
It takes about 10-15 seconds to download and generate the SQL, so backing up all the data took about 10 minutes at most.
So hopefully by doing this I’ve gotten a better idea of how I should be performing backups, this is going to be more important when openpeer goes live and for future projects. I’ll have some more time over the next 2 weeks, I’ll look into automating this whole procedure so I’ll be more happy to do it.








