I had a bit of a scare yesterday and, after all, was done and said, only lost one day of work. I thought I’d post what I understand on restoring backups in hope of helping others. Let my mistakes help you from repeating them with your blog. Backup your blog with confidence so you can rest easy and enjoy what blogging is really about… creating content! Backup all of your content, files and your database. Most bloggers are backing up only their databases and that can be a mistake.
Important details
First, I want to put in a disclaimer that I am not an expert and this is just my understanding. If anyone sees something wrong or sees something that should be added, leave it in the comments below so we can amend this post.
Second, I’m Using a dedicated server from Hostgator that uses cPanel so that is what this post addresses. Also, I use the Genesis Framework($) and a Child theme (eleven40 Theme($)) (I’ve since switched themes). This can be an important distinction when it comes to restoring certain files for your blog since there may be multiple files.
My Scare – Blog Crash
I decided to add Google Plus comments to this blog and changed the Functions.php file. I must have done something wrong because I suddenly lost everything in the blink of an eye. My blog completely lost everything, including the backend of WordPress. The only access I had was via FTP and cPanel.
Mistake Number One
Yesterday I upgraded to WordPress’s latest version ( WordPress 3.5.2.). Before I made this change I, of course, backed the blog up. What I should have done, is backed it up a second time AFTER updating to the latest version.
Mistake Number Two
Several hours after updating the WP version and making several changes on the blog, not to mention comments and comment replies, I made the Funtions.php error. I should have backed up again before making any changes. Now, after getting the blog restored, I have lost hours of work and all of those comments. That’s still better than losing the entire blog but I should have backed up again; I do know better and just got in a rush.
Genesis Framework
The great thing about WordPress and the Genesis Framework is that installation is so simple that anyone can use it. You don’t need any coding experience. The bad thing about WordPress and Genesis Framework is anyone can install it. In other words, anyone can get the blog up and running but when something goes wrong, you need to be able to fix it. That’s what this post is for; to help you with backing up and restoring your blog.
Recap – BackUp and Recovery Tips
- Backup your blog files and database before AND after any major changes and WordPress or plugin updates.
- Backup on a regular schedule. There are free plugins that may help you with this.
- You may have to change the database filename before using it to restore your blog. In my case, I have to change the backed-up file from
mylogin_wrdp1.sql
towrdp1.sql.gz
before the restore will work in the cPanel. - I like to rename files before replacing them rather than deleting or overwriting them. I just add something like -old to the filename. Once I know everything took, then I delete the old file.
- Step back and evaluate the situation before attempting a database restoration You may only need to replace a particular file, depending on what caused the problem. That was my case yesterday and I compounded the problem with an unnecessary database restoration when a simple file swap would have fixed everything.
- Don’t be afraid to ask for help. In my case yesterday, I sought help from the All About WordPress Facebook Group run by Nile Flores. That’s where I was fortunate enough to get invaluable help from Leslie Bogaerts. Leslie explained that the Genesis Child theme had it’s own Functions.php and I was replacing the main WordPress Functions file. In other words, I was replacing a file that had nothing to do with the problem. That kind of information would have taken forever to find by “Googling” it.
- Finally, here’s some advice from Nile Flores:
Always have a beta version of your site to make changes. Make the changes there first before applying them to your main live site.
Blog Back-up Options
If you’ve ever had a hosting company shut down or shut you down then you know that sinking feeling that you may have just lost countless hours of work. If you have ever been the victim of a heartless hacker you’ve been there too. I have had both happen. I had a hosting company that took the money and ran to never return again. That was several years ago. I’ve been hacked a few times too.
Starting over can be a terrible ordeal but if you have recent backups of your site files and databases you can quickly be up and running again. Below are a few options to consider.
FTP client
When you first start your blog it’s very important to keep a copy locally on your computer. Use the exact folder structure on your computer that you do on your site. When you add plugins, new themes or anything else to your site always put it in the correct folder and the FTP it to your server. I recommend weekly FTP backups if you make updates and changes regularly. It’s good to get in the habit of making these backups the same time each week. Set aside half an hour or so dedicated to blog backups each week. I recommend database backups daily but more on that below.
Want more on using FTP? Watch the video at: http://www.youtube.com/watch?v=O3DudpEMPiY
cPanel® Backup Option
If you are a technical person cPanel has their own tutorial for database backups.
WordPress Plugin
Austin Matzko offers a very popular WordPress plug-in that can be setup for automatic database backups. I use WordPress Database Backup on all of my blogs. I have them setup to email me daily backups.
Blogger Blogs
Alex Chitu @ Google Operating System Blog shows an easy way of backing up Blogger blogs using a Firefox extension. How to Backup a Blogger Blog
phpMyAdmin Backup
Daniel @ Daily Blog Tips shows how to use your phpMyAdmin to export your tables and database in his post “Backup Your Blog Regularly“.
Here’s a tutorial from SiteGround.com Inc.: MySQL Tutorial
Remote Data Backup Service
Using an online third party backup service may be another option. I had a list of sites for you but then I found this review of online backup services by Gadgetadvisor.com Evaluating Online Backup Services
The Importance Of Blog Backups With Backup and Restoration Tips
Related Post:
How To Backup All Of Your YouTube Videos
I was also messsed up by adding Google comments on my blog without backing up – that was a terrible mistake for me – thanks for sharing
It looks like you settled for Facebook comments Peter. I might hire someone, there’s not a lot online right nor for Genesis users.
Brian, Please don’t ever get rid of CommentLuv. You’d be surprised how many other sites list your website for commentluv and dofollow and stuff. Google+, Disqus, or Facebook comment sI refuse to use for commenting. – Scott Craighead
Thanks Scott, but I don’t plan on replacing WP comments and CommentLuv, just adding G+ comments to t. That way readers will have either option.
Boy i was too late reading this blog 🙁 I had my blog crashed and could only recover 50% of my previous posts and I still can’t figure out the reason so I guess readers of this blog do take care of backups on regular basis
Sorry to hear that Malik, I know how hard that is.
A very useful warning for all of us. I have installed a plugin to backup my files and database to my Dropbox account on a regular basis.
And I will make sure that I backup everything before making any changes to my blog.
That’s pretty clever backing up to Dropbox Sourav. I was just looking at a plugin that sends the backup to Google Drive as well. Living in the clouds 😉
You have convinced me to buy a external hard-drive to back up on my WordPress on instead of using digital. I just expect it to work and I never thought about a crash. I can usually fix it using using the FTP manager over at my hosting service. But, it is important to have everything in your hands and not on some other server you may or may not be able to access.
You might not need to buy a drive if it’s just for blog backup Scott. Check Sourav’s comment above. You can send backups to Dropbox or Google Drive if you like.
I feel like that’s not secure enough for me. Why not be able to hold it in my hand and not on some server miles away. Something could happen to it. But, I could do both! – Scott Craighead
Tip – When altering functions.php or any of the php files (rather than the css files) always back them up first. If you muck them up, the whole blog goes visually blank. It looks like everything is gone. All you have to do is to restore the files you were tinkering in and you’ll be magically back. Thesis users run into that all the time when altering custom_functions.php and making a minor error. You don’t in fact lose any data on those crashes but it’s highly alarming!
Kim
PS: Leslie and Nile are awesome!
Thanks Kim. I actually had a backed up copy but was replacing the wrong Functions file. Leslie helped me with that by telling my that there was a separate Functions.php in the Child Theme.
Hey Brian. Just a thought. Seeing as how your were playing around with you functions.php file when everything went haywire wouldn’t uploading a copy of that particular file put things right. I know when I start playing with any files I always save it first so that if I do stuff up all I have to do is upload the original file to put things right.
Oops’ Looks like Kim said the same thing sort of. Lucky for her she was here first. Now it looks like I’m trying to steal her thunder 😀
Yep, that’s all it took in the end but I was replacing the wrong file. By then, I had attempted a database recovery. There’s nothing like compounding a mistake with more mistakes. 🙂
Back-up after before and after every changes is the key. I’ve experienced this too, only that my blog was just a few weeks old and has not much content yet. I’ve learned from my mistake since then.
I’m glad you learned early Peter. 🙂
This is an awesome post but I don’t Back up my blog often I feel to lazy to do that 🙁
Is there any plugin that automates that process? Maybe free?
thanks in advance
anis, “BackUpWordPress”. It seems okay. I don’t know much about it but it does well in backing you up here and there per day. – Scott Craighead
Sure Anis, I use WordPress Database Backup and, yes, it’s free. There are others but this one is pretty easy to use and now I know from experience that it works. At least it did for me.
Hi Brian,
1. It seems that you sought help after the crash, after you were hit. You knew you are not an expert but you did it anyway.
A blog like yours is not just … yours. It is a collective work (you and your visitors) and when something like this happens, everybody is affected.
You wanted Google comments? Why? Probably somebody told you this is a good thing. More probably, you saw a lot of people doing it and you simply went with the herd.
This is a sign that something is wrong. You are not using your own judgement. You just look for social proof.
2. You wanted Google. Google is like the wind. You never know when they will do their next catastrophic change. What will you do when they will abandon their comment system? It might happen anytime, if they realize it is not what they expected.
You will try a new drastic change and, of course, a new crush will happen.
Now, what’s the use of collaborating to a site where the owner does things like this? Yeah. I am the owner of this site and I decide to do a drastic change. Next day I change my mind and do another drastic change. Your site will very fast become a dangerous place.
Do you own your comments on Google comments system? What happens with them if, for whatever reason, you decide to remove Google comments? You lose them all. So you gave up a lot of control of your site in exchange for social proof. Social proof is one of the least important indicators to take into account. Good policy.
Have a nice day
Nice post. And a great lesson for all of us. I was just thinking about of upgrading the WP version but was avoiding thinking about the compatibility issues. Learned a lot from your post. Thank you.
i am always ready for crashes so i regularly take backups of my blog.My Host Also Helps me in this thing.
nice post very informative tips for me. actually i have wordpress site and i used plugings for backup and security. thats time backup is most important. thanks for sharing.