How to Backup and Restore Your WordPress Blog

Mankind is a peculiar animal who never seems to learn from his mistakes. Even though I’m sure most of you have lost valuable files or photos during the years I’m sure just a fraction of you backup your computer.

The simply truth to why we don’t backup up our beloved things is that it takes time. Who want to spend one hour every week making a backup of their files when you haven’t lost something for several years?

Because of this it’s important to set up a scheduled backup. For the files on your computer you can use a network hard drive and a software to transfer all of the files once a week, but how can you backup your WordPress blog?

How to Automatically Backup WordPress

When scheduling a backup of your WordPress blog you need to backup two things. Your database with all your posts and the files with all your images.

Because of this we need to use two different tools. One plugin for WordPress named WP-DB Backup and a software for Windows named SyncBack.

Database

Go to tools –> Backup. Here you’ll see a lot of different checkboxes, but scroll down to the bottom where you have Scheduled Backup.

Fill in how often you want to make a scheduled backup and which tables to include. Personally I prefer to make one every week or daily, but it’s up to how you depending on how often you make a new post.

Enter your mail and press Schedule backup.

I’ve also created an account on Google Mail to archive every backup i create.

Files

Now we have a scheduled backup for all of your posts and comments, but what about your images and themes? Since WordPress doesn’t support this service we need to use a third part software and for Windows I’ve found that SyncBack works great. Any recommendations for Mac?

Before doing this I recommend you to take a manual backup of your files since a small mistake could cause you to lose all of your files.

Click on the folder next to Destination in your upper right hand corner.

Click Yes and browse to the directory you want to backup, then hit OK.

Now you do the same thing with Source and choose where to backup.

Go to the Advanced tab.

Under What to do if the same file had been changed in the source & destination? you select Destination overwrites source always (restore).

Under What to do if a file is in the source but not in the destination? you select Delete file from source.

Under What to do if a file is in the destination but not in the source? you select Copy file to source.

Go to the Background tab.

Select how often you want a backup of your files.

As you can see above there are some settings you need to change when using SyncBack. This is because the software are built to work the other way around and send your backup to a FTP instead of getting it from one.

Remember to do a manual backup of your files with your regular FTP software before setting this up since it could cause you to lose all of your files if you use the wrong settings.

How to Restore WordPress

For some reason you’ve lost all of your posts or files and now need to restore WordPress. Thanks to our previous backup this is piece a cake.

To restore your database you need to use phpMyAdmin, a software used to manipulate a database through a web interface. If your host doesn’t have this i highly recommend you to change WordPress hosting.

Upload your files with a FTP software.

Login to phpMyAdmin.

Click Databases and select the database you will be importing to.

Click the Import tab in the top of your screen.

Click on the Browse button and select your latest backup from the mail.

Click the Go button.

Go have some fun while waiting.

Depending on how many posts, comments and categories you have this may take a while but the whole process should help itself.

I had always wondered “am I doing enough” as far as backup. I am NOT doing enough. I have the database backup scheduled with the plugin but was only backing up the files manually once every month or so! I’ll get SyncBack right away. Thanks for the great post!

You’re welcome. I recently mentioned how I lost Google AdSense Generator because of lack of backup. It took me some hours to create it all over again, which I wouldn’t had to do if I only had a backup.

Well, Stefan, I certainly won’t want to learn this the hard way. ^^ Thanks so much for providing the step-by-step how to’s. I’m amazed no one is stumbling this post yet so I did. A great tutorial for me as a WP newbie, surely for others too. Going to get my WP blog secured.