Backing up the new server... - Page 1
Forum section: electronics / general

author: EEVblog
author_rank: Unknown
timestamp: September 18, 2011, 12:24:30 pm
content: Ok, so I've got this wizz-bang new dedicated server that screams along, and all is right with the world.But now comes the question of how I back it up?My previous shared host took care of daily off-site backup for me, plus I backed up the databases myself every week or so.But I figure it would be nice to have some automated way to do all this on the new server.The new server runs a cPanel account under WHM and it seems to be able to do it's own backups, but presumably to the same hard drive, which kinda defeats the purpose...It has a RAID 1 dual drive system, and my server is "fully managed", so presumably if (when) a drive does fail, some geek at HostGater will be alerted and will swap out the drive. So baring direct meteorite impact, or some huge power surge, the likelihood of my losing both drives at once seems low, but you gotta be prepared.Any pointers?Happy to pay for some automated third party system that can log in daily and back it all up (files+databases) (via HWM or cPanel, or whatever).No fancy penguin stuff please, I just want something that works at a high level for idiots like me.Perhaps something like this service?http://www.siteautobackup.com/The critical stuff is of course the databases and the site files, as presumably HostGator will be able to get my WHM server back and working if it goes bung.Thanks.Dave.

author: Chet T16
author_rank: Frequent Contributor
timestamp: September 18, 2011, 12:33:12 pm
content: http://mikehigginbottom.com/content/automatic-cpanel-backupsAny use? Someone that knows what they're doing could get it to ftp to your other shared server?

author: EEVblog
author_rank: Unknown
timestamp: September 18, 2011, 12:48:37 pm
content: Quote from: Chet T16 on September 18, 2011, 12:33:12 pmYes, I was thinking along those lines. I do have 3 others shared servers :->Dave.

author: ndictu
author_rank: Regular Contributor
timestamp: September 18, 2011, 12:56:40 pm
content: What is running on the new server? Just this forum?For forum you have multiple things to backup:Static files - not that important, you can always download the forum source, but make sure to backup any custom changes (in templates for example - the findchips header and stuff like that). You probably need to do this only once and then when you change something.User uploaded static files - I'm not familiar with this forum but most store user uploads in some directory instead of database so you can just backup that by copying the directory contents over FTP/SCP, or if you are feeling fancy you can do some rsync backup (this is probably better in the long term, you can prepare some rsync command and run it once in a while and I'll only copy the new stuff)Database - the most important thing, since the content is all there. You can do exports through phpMyAdmin although for large databases that doesn't work well. You can do direct connection to the sql server with some desktop app and use that, or if you have SSH access then you can export locally and copy over FTP/SCP.Then you have a few options how to do this, either yourself and keep it on your local harddrive or pay some service. You should probably talk to your hosting provider first, I'm sure they do this all the time and they could do filesystem and database backups for you to another (preferably offsite) servers. The site you linked looks pretty unprofessional and sketchy but someone could probably recommend an external backup service. But I think you will do better with a service from your hosting provider.

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 18, 2011, 01:01:41 pm
content: Get rsync or something similar installed on the server so you can just keep a copy synced on your PC.

author: Unknown
author_rank: Unknown
timestamp: September 18, 2011, 01:49:18 pm
content: Have you talked to your hosting provider? Given your operating from a built config and not just a raw server there is a good chance they already have some form of disaster recovery in place for your server.The rub is in what form this takes how often and what is backed up. Losing a disk in the raid array for example there is a good chance you'd never know it occurred or was fixed.Should a more catastrophic failure occur I'd want to know what your host provider will deliver in the way of recovery and replacement. You really want to know this as the basis of your backup strategy. You want to know how, what, and how often they backup, then you have to decide how much you trust their backups.No backup strategy is ever perfect, unless there is a team working on it full time, and often having a team working on it full time is a guarantee all will not go smoothly.

author: Unknown
author_rank: Unknown
timestamp: September 18, 2011, 02:17:11 pm
content: Quote from: EEVblog on September 18, 2011, 12:24:30 pmRAID is redundancy, not a backup system. If a software issue, cracker or fat-fingered admin causes corruption or data loss (oops, just dropped the wrong database), RAID will to its utmost best to replicate this error to all disks within seconds.I agree with the other posters that there is no point in backup up the system files (eg. OS, cPanel). Your hoster can probably install this on short notice, and getting it to run on any other cPanel server should be fairly straightforward. Backup the configuration of WHM/cPanel may be a good idea, though.Quote from: Uncle Vernon on September 18, 2011, 01:49:18 pmI would never rely exclusively on their backups. Issues can remove access to both your server and their backups. Like all servers being seized due to conflicts between companies, conflicts between the customer and the hoster, common infrastructure failing (eg. same datacenter). You don't want to be able for anyone to keep your data hostage.Backups are useless without testing the restore (backups are easy, restoring is the hard and important part). Will your hoster do a regular test restore so you can verify that everything is intact? How else will anyone know that the backup system didn't run out of space and stopped storing backups?I would just dump all databases and copy the results to another server, so I'm not familiar with the 'more idiot-friendly' solutions. I would make sure to keep multiple revisions of the data, so you can go back to an older version if corruption occurs. The last system I designed used a quasi-exponential interval between backups: keep X backups spaced an hour apart, Y spaced a day apart, Z spaced a week apart, and so on.

author: ndictu
author_rank: Regular Contributor
timestamp: September 18, 2011, 02:43:35 pm
content: Quote from: alm on September 18, 2011, 02:17:11 pmYup. Either on your home computer if you have it running all the time, or some other server (different provider or at least different location). Have a cron job run some backup script every day for example.http://rsnapshot.org/looks like it could work for the filesystem sync, with a little onetime configuration.For the database it depends if you can access it from remote server (many hosting providers disable it for security), or run the dump trough SSH on the remote machine and then download the resulting file to the backup server, again possibly using rsync/... to delete old ones. Also, depending what DB server you are using there could be a better way, some support various fancy backup strategies like online remote replication, where one server (slave) is constantly kept in sync with the other (master), and then you can just dump the slave on the remote machine locally.All that being said, just write your provider a mail, "guys, I need backup, what do you got?". They will probably have some extra cash service where they will take of this for you, they know what they are doing and so on.BTW, you should in any case have a few backups on DVDs stored somewhere, maybe make a full backup every week and keep it for the worst case scenario.

author: Unknown
author_rank: Unknown
timestamp: September 18, 2011, 02:46:00 pm
content: Quote from: alm on September 18, 2011, 02:17:11 pmIndeed! I'd like a dollar for every time I've tried to explain to the penny pinching and clueless why both are required. At least RAID eliminates one (and only one) possible reason for requiring a restore.QuoteAgain I'd agree. I was not suggesting reliance upon the Provider for all things back-up. Still knowing what the HOST backs up is important in determining what frequency you back up what piece of data.QuoteAgain a good point. The CPANEL style hosting will never offer the user a means of absolute recovery, and when up-time equals income it's worth having a DR (disaster recovery) plan in place. Where do you switch your hosting to, quickly, if any of the above scenarios arise?Along the same vein make sure you always retain management of your own DNS, relying on the host provider for DNS means the host provider has the upper hand in any dispute. You cant tell them to take their hosting and shove it, if it's going to take you days to redirect requests to an alternate location.QuoteYou've seen those tears too!QuoteIt's a trade off, that will keep changing. The cost of maintaining a workable back-up strategy vs the income and reputation loss of not effectively backing up.The more complex your system the more complex or expensive the back-up solution that is required.The Databases are the most important area for back-up, but as the current server migration is demonstrating, the time and effort required for set-up is no longer trivial.

author: electrodynatronic
author_rank: Newbie
timestamp: September 18, 2011, 02:50:29 pm
content: Contact this guy. If I'm not mistaken, he used to be an admin at Hostgator. He does this sort of thing for a living. He's quite good, and reasonable.http://www.kallisteconsulting.com/backups.html

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 18, 2011, 03:00:09 pm
content: Quote from: alm on September 18, 2011, 02:17:11 pmredundancy is a backup. backup is a redundancy. if one RAID is failing such as hardware damage, those errors made by the fat fingered admin, will be backed up by the other RAID. isnt it?

author: ndictu
author_rank: Regular Contributor
timestamp: September 18, 2011, 03:24:56 pm
content: Quote from: Mechatrommer on September 18, 2011, 03:00:09 pmI'm not understanding what you are saying, first you disagree with alm and then restate what he said. Anyway...RAID is just what it's named after, redundancy. If you have mirroring with RAID1 or some parity striping with 5/6/... you can have a single drive failure without downtime. If you are running some server that can't have several hours of maintenance downtime this is important. If a drive fails, you just pop it out of the hotswap bay, throw it in trash and replace it with a new one you have ready. The data will be replicated and unless you have another failure during this time your clients/visitors won't even know.On the other hand, if somehow your data gets deleted, corrupted or you have multiple drive failures you are screwed. If you update some software and it breaks your data the RAID controller will mirror these changes over all your disks and there is no way to go back. It's not a backup. It's just a harddrive that is either/and/or(depending on setup) bigger, faster and more reliable than the individual harddrives in the RAID. Nothing more.You need backups for such cases. Worst case just backups on the same drive. Better on a different drive, same machine. And so on, until you get to high-quality tapes for longterm storage packed in sealed containers in temperature and humidity controlled room on a different continent than the server you backed up.

author: SgtRock
author_rank: Unknown
timestamp: September 18, 2011, 04:34:22 pm
content: Dear Dave:--At the very least use a different entity which keeps the backups in a different city."Three weeks in the lab will save you a day in the library every time" Stanley Williams, HP LabsBest RegardsClear Ether

author: Lanman
author_rank: Contributor
timestamp: September 18, 2011, 06:27:00 pm
content: Yep. I had a RAID controller go bad in a RAID 5 array and it spewed garbage across the entire array. It was a total loss and required a full restore from the previous night's backups. RAID is certainly a wonderful thing but never forego real deal backups. I agree with previous statements in regards to seeing what the hosting site might provide for backup & disaster recovery.Dave

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 18, 2011, 08:25:59 pm
content: Quote from: Lanman on September 18, 2011, 06:27:00 pmthen whats the point of redundancy? why it existed/invented in the first place? could somebody shut it down? well, thats not so helpfull isnt it? maybe a bug in the implementation.

author: ndictu
author_rank: Regular Contributor
timestamp: September 18, 2011, 08:38:02 pm
content: Quote from: Mechatrommer on September 18, 2011, 08:25:59 pmAs I already said:Quote from: ndictu on September 18, 2011, 03:24:56 pmIt takes a number of harddrives and gives you a new "virtual" harddrive with better properties. RAID0 gives you more space (and possibly speed, when doing access over multiple physical disks), but reduces the reliability. RAID1 gives you more reliability and faster read speeds. There are many more combinations.The problem is, no matter what RAID configuration with how many harddrives you use, it is still just one better drive. Software error? All data corrupted. Malicious attack? All data corrupted/compromised/gone. Power failure? Possible corruption.That is all it is. Replace every RAID setup with a bigger/faster/more reliable harddrive and nothing is changed. Do you consider a single harddrive a backup solution? If not, you can't consider RAID a backup solution.(Leaving out the another feature, in case of failure of just a single drive [multiple with some configurations] and controller that can do hotswapping you also avoid downtime, but this can be also thought of as a single harddrive with a higher MTBF)

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 18, 2011, 09:42:23 pm
content: you're talking RAID 0 right? ok i surrender, i dont have enough experience in this. i myself prefer manual backup (norton ghost or whatever) instead of this flowerish technology.

author: electrodynatronic
author_rank: Newbie
timestamp: September 18, 2011, 09:46:35 pm
content: There is no RAID spec that will protect your data if a piano falls on it.

author: EEVblog
author_rank: Unknown
timestamp: September 18, 2011, 11:00:16 pm
content: I knew everyone would mention the RAID thing!Trust me, I know all about RAID and how it's a redundancy system, not a backup system.Likewise I know all about keeping things offsite, multiple staggered copies, restoring etc so no need to explain.All I need to know is the different ways available to automatically get the important data out of my system and stored somewhere else (I know how to do it all manually, but that's a PITA, I want to automate it)Yes, the important data is the SQL databases and the forum file attachment (but might as well back up the entire Wordpress and Forum directories anyway). Syncing is nice to have, but it's not a proper backup system, just like RAID. It's not huge in the scheme of things, just a few GB for a snapshot of my home directory.I'll speak to HostGator and see what's available at that end.ThanksDave.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 18, 2011, 11:40:47 pm
content: One thing I would recommend is making a complete system image periodically, or at least once. Obviously it doesn't need to be done as frequently as the database, but it is still good to have on hand. In the event you have to do a system restore it will give you a good place to start. If you are lucky you can just load the image, then load the most recent data backup and be up and running. Even if you can't or don't do this, it can be handy to have the image to refer to if you can't figure out why the configuration is wrong. In a system where recovery time is really critical it would be standard to do a complete system backup after any change to the system, with the varying levels of painful protocols to make sure this happens in practice.Anyway, for backing up databases you usually use whatever is backing up your files, just make sure it runs the database 'hot backup' script before and after it runs, or generates a database dump file and includes that in the backup instead of the native backup files. The hostgator 'run backup' button may or may not by default automatically put your database in a state to be backed up, but I would expect it could be configured to do so.I don't have any experience with fully managed servers, so I don't really know what the options are. I use the program 'duplicity' to run my backups. It can do incremental and full backups with compression and encryption, and it can store the backups via FTP, SSH/SFTP, webdav, Amazon S3, and others. It should have no problem dumping backups to one of your shared servers.

author: EEVblog
author_rank: Unknown
timestamp: September 19, 2011, 01:55:31 am
content: Damn, it turns out my new server doesn't have RAIDhttp://support.hostgator.com/articles/hosting-guide/hardware-software/raidI AM NOT HAPPYDave.

author: amspire
author_rank: Super Contributor
timestamp: September 19, 2011, 03:02:04 am
content: Quote from: EEVblog on September 19, 2011, 01:55:31 amProbably not a big issue. Most of the time, drives seem to last a few years reliably then get upgraded. When they go down, the hosting companies rebuild pretty quickly now.Here is an automated backup script from my hosting provider Site5.com that you could use as a starting point for an automated backup:http://forums.site5.com/showthread.php?t=10720It dumps the backups to the server drive and it has the option of FTP the backups to another site - if you have another site to FTP to. All the cpanel sites are pretty similar, so the script will probably work fine.The nice thing is if the server is heavily loaded, it will wait for the server load to reduce before doing the backup.You then just have to regularly download the backups. A pain. You could get a separate $5 a month site and send backups directly via FTP from hostgator, but you have to be careful. The rules for the cheap sites often stated that you are not meant to use them as a backup site. If you keep only, say two backups, you can probably get away with it. If you keep accumulating backups, you will probably get caught. I have had 50Gbytes+ of zip files sitting on a cheap site5.com for a period of about 12 months site without any complaints.The big thing about backups is it is worth practicing a restore to a new site - it is an interesting experience. It is really easy to restore wordpress files, restore the MySQL wordpress database only to get the "Cannot connect to database error". (Got to get that wp-configure.php file right).You can set up a test server at home on an old PC better still as a VMware virtual machine running under the free VMware player. Using the preconfigured Bitnami linux distro's makes it pretty easy:http://bitnami.org/stack/wordpressIt should be no problem adding the Simple Machines forum to a bitnami stack. The main catch is that website links are often domain name dependent - things just don't work right if the site is not called "eevblog.com". The quick cure is you temporarily add a line to your PC's hosts file to point eevblog.com to the test system.Richard

author: JonnyBoats
author_rank: Regular Contributor
timestamp: September 19, 2011, 03:21:17 am
content: My advise is to worry about restores, not backups ;-)Setup a routine where you have a hot server in your house that is fully operational and updated from production nightly. That way if you wakeup some day and find that your hoster went out of business...I can't begin to tell you the number of times I have seen professionals with "perfect backups" that simply would not restore when the time came to use them. This happens for lots of reasons, too numerous to mention.

author: Trigger
author_rank: Regular Contributor
timestamp: September 19, 2011, 04:36:10 pm
content: Redundancy mitigates the effect of hardware failure, but it doesn't protect against everything. A backup is an offline copy of your data which is protected against actions that would make the online data set unusable and to which redundancy has no effect on.It's best to have the backup offsite as well. That way if there is a failure (fire,etc) at the hosting provider then you can migrate to a new one.I've run quite a few networks and seen the results first hand of people who thought redundancy was equivalent to backups. It wasn't pretty.

author: ndictu
author_rank: Regular Contributor
timestamp: September 19, 2011, 07:38:26 pm
content: Quote from: Trigger on September 19, 2011, 04:36:10 pmYup. Did you just write 'rm -rf /', copied the old files over the new ones when you meant to do it the other way, write 'DELETE * FROM table' but hit enter before specifying the where clause? Well you are screwed, before you realize what just happened your RAID controller is already syncing the change across all drives

author: firewalker
author_rank: Super Contributor
timestamp: September 19, 2011, 07:58:16 pm
content: If there is an automated way to keep backups in the servers HDD you could only sync the backup files to your home pc using an incremental system or what ever you wish.I find rsync excellent for that kind of tasks.There is also more user friendly programs for the task likeSuper Flexible File Synchronizer.Alexander.

author: gamozo
author_rank: Regular Contributor
timestamp: September 19, 2011, 08:44:27 pm
content: I work for the company that makes GoodSync, so I'll have to suggest that here.http://www.goodsync.com/