Backing Up and Migrating WordPress Websites

Backing Up and Migrating WordPress Websites

As much as I love the WordPress software, sometimes things happen. Your site may crash, a login might be hacked, you may need to move your site to another host, or you may want to move your site to another CMS altogether.

Moving website files is scary. I'm not going to pretend that it ever isn't. Even when I feel confident that I know what I'm doing, it feels like something can still go wrong. So don't feel alone if you feel the same way!

That doesn't mean that you can't have a strong knowledge of HOW to do it. If you do or plan to manage a WordPress site, you should know how to take backups, restore from a backup, and how to migrate a website. You never know when something may happen that will require a backup, or when you may need to move your site somewhere else.

Backup and Migration Basics

First, we need to understand how WordPress is structured.

A WordPress site is essentially made up of two parts: the files and the database.

The files are what you get when you click download on WordPress.org: a zip folder that contains many folders, each of which contain files. The files can include:

  • Pictures and media
  • WordPress dashboard files
  • Theme files
  • Plugin files

The database is created on your server. It's a storage for all your website data using something called MySQL. The database can include:

  • Page text
  • Post text
  • WordPress settings
  • Theme settings
  • Plugin settings

When backing up or moving a site, both of these things need to be moved and both need to be connected to each other. There's a file called wp-config that contains PHP which connects the files to the database using a database name, user, and password. It's very possible that if you are moving a site and get a database error, it's because something went wrong with these credentials.

Now that's a very quick and basic run-down. If you want to learn more about files and databases, I highly recommend this article from MalCare. You don't need to understand all these things in order to run backups or migrate, but they are extremely useful to know in case something goes wrong.

Taking Backups

A backup is a copy of your site taken at any given point that can theoretically be used to replace a future version of your site. They are extremely useful to have. I've always recommended at least taking monthly backups. If you have a ton of traffic, post a lot of new content, or sell a lot through the site, more frequent backups are better. Some sites with huge numbers of sales per day take a backup once a minute!

There are two ways to take backups - manually, or through a third-party tool like a plugin.

Manual Backups

You can manually take backups using cPanel, however this method is becoming outdated.

You can also take manual backups using FTP. Open up your FTP client and find the root directory of your website. The root directory contains folders like wp-content and wp-admin, so if you see those, you are in the right place. Choose which folder to backup, or choose multiple. You can select and right-click on them, then choose download. Save the files on your computer or on a cloud drive.

But wait - we only saved the files. What about the database?

Depending on the web host you're using, these steps may change a little. But here's the gist. In your hosting account, go to the cPanel or wherever your dev tools are. Find a menu item called phpMyAdmin and select it. You'll see the database(s) on the left. Select the one that you want to backup. Then choose all the tables you want to backup. Choose Export from the top menu. Then choose Go. This will save the SQL file on your computer, or you can move it to a cloud drive.

If you want to know more about taking backups, I recommend this article from WPBeginner.

Assisted Backups

The above methods involve going into your files directly. Perhaps you don't want to do that, can't access those files (Managed WordPress hosting can make that hard) or you want to automate the backups so you don't have to do them yourself.

There are tons of plugins and tools that specialize in taking backups. My favorite is what we use at Web Pro Geeks to manage our client sites: ManageWP. Within it, you can schedule backups at whatever interval you want. The program downloads the backups automatically. You can then go into the site within ManageWP and select to view or restore from a backup. ManageWP does it all for you.

Plugins are also a good way to take backups. However keep in mind that if a site crashes and you need to restore it, chances are the plugin won't be accessible. This is why it's so important to store backups in multiple places.

You can use plugins like Updraft Plus or Duplicator to schedule backups. They give you the option to store backups in the cloud. That way, if the plugin settings are unavailable, you can still access the copies of the website. Each plugin has different setup instructions, so choose the one that looks best and get to work!

Restoring from a Backup

Taking the backups themselves is great. And totally necessary. But the backups are only valuable if you can actually use them in an emergency. Restoring a site from a backup can be tricky, so take a deep breath and take your time.

If you use the plugin method: The first step is to delete all the WordPress files currently active. Do that using FTP - select and delete all the files and folders within the root. If you have a local backup of your files, upload them here. Or, you can download WordPress fresh from WordPress.org and install those files. Now, you should be able to log in to WordPress and restore your backups using your plugin.

To restore a database, log in to your host and access phpMyAdmin like we did before. Last time, we performed an export. Now, we need to perform an import. Select your chosen database, then choose Import from the top menu. Select Choose File under File to Import, then select your backed up database. Make sure the format is SQL then click Go.

Migrating a Site

Guess what? Since you now know how to restore a backup, you know almost everything there is to know about migrating a site! You'll follow the steps we just outlined on the new server instead of on your existing one!

(Keep in mind that some hosts offer migration services - check in with yours to see.)

There are a few things you'll want to make sure you do when migrating a site using a backup.

  1. Edit your wp-config.php file. Open this one up using FTP and find the DB_name, DB_user, and DB_password. These will most likely point toward your old database. Make sure that these match the values of whatever current database you're using.
  2. Configure and Change the DNS. The Domain Name Server has to be pointed toward the correct host. Otherwise, your domain name will try to send visitors to the old host where your files don't exist. On your new hosting account find the DNS details section in your settings. Find the CNAME record and A NAME for your website. Contact wherever you purchased your domain from, and request these values to enter into these sections. You may actually be able to just look it up without contacting anyone.

Believe it or not, that's pretty much all you need to know in order to begin your migration.

If you want to learn more about migrating a website, I recommend this article from WP Engine.

Thanks for joining me! If this helped you, please let me know in a comment or by sharing this article with your network.


This edition of the newsletter was kindly sponsored by Web Pro Geeks, LLC.

Paul Truong

I build websites that help marketing and fundraising teams at not-for-profits make greater impact. I'm creating a course to help you create your own personal website. No web development experience needed.

1 个月

Good point about not being able to use plugins for backups and migrations if your site is down Allie! Always better to have backups set up outside of your website for that reason. Wanted to also add that its a good idea to periodically test your backups. The last thing you want is needing to restore and realising your backups are corrupt

要查看或添加评论,请登录

Allie Nimmons的更多文章

  • How to Redesign a Website

    How to Redesign a Website

    In a previous edition of this newsletter, we talked about auditing your own website. An audit helps you find areas of…

    3 条评论
  • How to Add Custom Fonts in WordPress

    How to Add Custom Fonts in WordPress

    Before we begin, I just wanted to say a huge thanks to you if you've subscribed to this newsletter! I just passed the…

    2 条评论
  • A Quick Tutorial for Custom WordPress Login Screens

    A Quick Tutorial for Custom WordPress Login Screens

    One of my favorite things to do to elevate the WordPress site experience is to customize the login screen. Not only is…

    2 条评论
  • 6 Tips for Making Your Blog More Accessible

    6 Tips for Making Your Blog More Accessible

    WordPress was founded as a blogging tool before anything else. And it's roots still make it a fantastic content…

    1 条评论
  • How to Audit Your Own Website

    How to Audit Your Own Website

    So many small business owners have to DIY their website. From time to money constraints, it’s just a fact of life that…

    2 条评论
  • Why is WordPress So Great for SEO?

    Why is WordPress So Great for SEO?

    Search Engine Optimization (SEO) is a tried and true method for helping your content rank on search engines, most…

    1 条评论
  • Do You Need a Chief Web Officer for Your WordPress Site?

    Do You Need a Chief Web Officer for Your WordPress Site?

    So much of the power of WordPress comes in at the intersection of marketing and technology. When a marketer, social…

    3 条评论
  • What is WordPress? And What Isn't?

    What is WordPress? And What Isn't?

    In a previous edition of this newsletter, I discussed the difference between WordPress.org and WordPress.

    5 条评论
  • Creating a Downloadable PDF Link in WordPress

    Creating a Downloadable PDF Link in WordPress

    Sometimes you want to do something super simple..

    5 条评论
  • Delivering a WordPress Website

    Delivering a WordPress Website

    So picture this: you have been working on a site for a client for months. Maybe you are the designer, the developer…

社区洞察

其他会员也浏览了