WordPress backup and restore — an easy method that puts you in control

One of the challenges of running a WordPress blog is backing it up. There are so many options to perform WordPress backups, but do you really know whether they will work when you most need it?

Has someone hacked your account? Or a virus scrambled your blog content? Perhaps your hosting service has gone out of business and left you with nothing? Maybe you simply want to move your WordPress blog or web site to a new domain?

WordPress backups are not something that can be left to chance. When you need to be able to restore your web site that you have worked on for several years, you need to have confidence that you can do it.

Unfortunately, many of the available WordPress backup plugins just leave me feeling confused. What exactly are they backing up? Will they actually be able to restore my blog web site in my time of dire need? Do they have enough flexibility to be able to restore onto a different server, in a new directory or even a new domain name?

I run a few blogs and simple web sites using WordPress. Following is my method of backing them up.

I have backed up using this method, and then reinstalled the web site onto a new domain on a different server successfully. If you choose to adopt this method, you should also do a test reinstall to make sure it works. Fortunately I have never had to do a full recovery, but I am confident that it will work for me.

My approach to WordPress backups is based on ONLY backing up the user created content. That is posts, pages, comments, custom fields, categories, tags and all media uploaded to the site, such as photos. This is the content that I have developed over several years and simply can not be replaced if I lose it. This puts you in control of what gets backed up.

I figure that I can relatively easily install a fresh copy of WordPress, apply the theme and load any plugins that I am running. I therefore do not bother backing up these elements.

How to do a WordPress backup

Firstly, ensure that you are running the latest version of WordPress and any plugins. This will minimise any potential compatibility issues should you ever need to restore your backup.

There are two key things that you need to backup to a safe location on your computer.

a) Posts, pages, comments, custom fields, categories, and tags — Install the WP-DBManager plugin. Use the Backup DB tab to do a full backup of your database and save it to your computer using the Manage Backup DB tab.

b) Media — you need to take a copy of all directories and files in the wp-content/uploads directory. You can use FTP, but I prefer to log into my cPanel control panel (you may be running a different system, such as Plesk), select the file manager, and then save a zipped file of the entire directory to my computer.

You have now backed up the user generated content on your WordPress blog. Easy.

You should do this regularly — I have automated the WP-DBManager plugin to email me a database backup once a week. I also take a full copy of the wp-content/uploads directory about once a month. I know that I have copies on my computer of any files that I upload, so taking a regular full back-up of the uploads directory is not as essential for me.

How to restore to the same location

If you simply need to restore to the same location, it is easy.

1) Do a fresh install of WordPress. Ensure that it is the current version. Install the WP-DBManager plugin.

2) Upload the media — Upload the zip file to wp-content/uploads and unzip it. Make sure you do not end up with two uploads directories by accident, ie wp-content/uploads/uploads. You need the media to be in the same location relative to the other WordPress files as they were previously.

3) Upload the database backup file onto your web server in the wp-content/backup-db directory using FTP or the file manager in cPanel (or other system, such as Plesk). The backup should then appear on the Manage Backup DB tab of the WP-DBManager plugin. Select the file and click restore.

4) Apply any themes and plugins that your web site runs.

Your blog or web site should be back up and running.

How to restore to a different location

If you are installing to a new domain name or subdirectory, there is an additional step that you need to do to make the internal web site links work. WordPress uses full URLs to link to media and other content, rather than relative links, so you need to change these.

After importing the database into WordPress in Step 3 above, go into the database (use the cPanel phpMyAdmin utility or similar) and browse the wp_options table. You need to find and change the siteurl and home fields to your new web site address. You should then be able to log back into the WordPress management interface.

You will then need to use a plugin such as Search and Replace to change the rest of the full URL links within the SQL database.

Test it!

Before you rely on this method for WordPress backups, test it! Do a practice backup, and then do a test restore to a new location, such as a sub-domain. Make sure that all links, both to content and media, work and point to the new web site location.

The usual disclaimer applies.

13 thoughts on “WordPress backup and restore — an easy method that puts you in control

  1. fridge repair

    Hi there would you mind stating which blog platform you’re working with? I’m going
    to start my own blog in the near future but I’m having a hard time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something unique.

    P.S Apologies for being off-topic but I had to ask!

    Reply
  2. Venetta

    I’m truly enjoying the design and layout of your site. It’s a very easy on the eyes which makes
    it much more pleasant for me to come here and visit more
    often. Did you hire out a developer to create your theme?
    Excellent work!

    Reply
  3. to Buy penny Stocks

    You should aim to carefully analyze the companies that you
    want to invest in prior to actually investing. You should write down the prices of these company’s stock, the date, and the reasons why you are wanting to invest in them. Once you do this, carefully follow the stock. Eventually, you will discover if purchasing the stock would have been a good or bad decision. Over time, you will get better at selecting good businesses. This is when you should actually begin participating in the stock market.
    __________________________________________________________________________

    I Break For to Buy penny Stocks

    Reply
  4. Ruby

    Hi! I know this is kinda off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having difficulty finding one?

    Thanks a lot!

    Reply
  5. refrigerator parts and repair

    Hello there! It looks as though we both have a interest for
    the same thing. Your blog, “WordPress backup and restore” and mine are very similar.
    Have you ever considered writing a guest article for a related website?
    It will definitely help gain exposure to your blog (my
    website recieves a lot of targeted traffic). If you happen to be interested,
    email me at: kenlocklear@gmail.com. Appreciate it

    Reply
  6. 24 hour appliance repair

    Hey there! This is kind of off topic but I need some help from an established
    blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking
    about making my own but I’m not sure where to start. Do you have any points or suggestions? Appreciate it

    Reply
  7. Gonzalo

    Have you ever considered creating an ebook or guest authoring on other sites?
    I have a blog based on the same ideas you discuss and would love to have you share some
    stories/information. I know my audience would enjoy your work.
    If you’re even remotely interested, feel free to shoot me
    an e-mail.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *