How to Move a WordPress Website to a Different Hosting Server
Today, we’re going to talk about how to do a WordPress website move—and there are a million variables when it comes to moving sites.
Rest assured that we’ll keep this super simple for now and then do some follow-up classes on all the ins and outs of what could possibly go wrong. (So there’s probably not enough time for all of them, but we’ll do our best!)
Step 1: Backup Your Site Files
Before making any moves, let’s play it safe and backup our website.
As you’ll see from the video below, we’re only pulling the wp-content folder for our example site move, but you’ll very likely have more files and folders than that.
My recommendation in these cases is to just move the whole thing.
- Some hosting providers (like SiteGround) offer “archive” and “download” services.
- If your host does not (like the dreaded GoDaddy family of hosting companies), then use an FTP tool like Transmit or FileZilla to connect to your current host. There’s a bunch of different tools you can use and a bunch of different ways to connect to the server.
Find your WordPress root folder (often named public_html
or www
) and download it to your computer. This might take a bit, so grab a coffee while you wait! ☕️
*** As I mention in the video, this is a very basic example of a site move. As with most things, there are a million variables you will run into. ***
Step 2: Back Up Your Database
Your site’s database holds all your posts, comments, and settings. Access it through your host’s control panel, usually via phpMyAdmin.
Once there:
- Select your database and go to the “Export” tab. I cover a couple of options about this in the video. Pro tip: I use WordPress Developer Resources’ guide every. single. time.
- The only two things you’re going to click each and every time is:
- Add DROP TABLE
- IF NOT EXISTS
Step 3: Set Up a New Database on Your New Host
Over at your new host, you’ll need to create a fresh database.
- In your control panel, find the MySQL Databases section. (It’s worth noting that on SiteGround, as you’ll see in our second video, a db/user/password will be created automatically, so it’s super important to make note of those pieces of information.)
- Create a new database.
- Add a user (note the password)
- Add that user to the database with “all” the privileges
- Then, using phpMyAdmin, select your new database, go to the “Import” tab, and upload the
.sql
file you saved earlier.
Step 4: Upload Your Site Files to the New Host
Just as we noted above, some hosting providers have upload functionality (more in the video), so you won’t always need to use an FTP client.
- With SiteGround, you can upload your saved zip file to the root directory and extract it once it is there. This tends to save a bunch of time. It’s worth noting that your hosting provider may have upload and extract file size limits. If you run into errors, this is one of the potential issues.
- Otherwise, connect to your new host via FTP, navigate to the root directory, and upload the site files you backed up earlier. This might take some time, so maybe catch up on your favorite show in the meantime. (I can’t recommend Brooklyn Nine-Nine enough! 📺)
Step 5: Tweak the wp-config.php File
Now it’s time for tweaking!
- Locate the
wp-config.php
file in your site’s root directory. - Open it and update the database name, user, and password to match the new credentials you set up. As we mentioned above in Step 3, you will need those credentials.
In the case of the site move in the video, we already had a site up and running and we were just replacing “everything” with our old site. In those cases (and since you’re “importing” a database), you don’t need to worry about touching the wp-config file since the database is not changing.
Wrapping Up
Migrating your WordPress website might seem daunting, but with these steps, you’ll have it done in no time. And remember, if you choose a reliable host with great features, the effort will be well worth it.
Happy migrating!
Watch the training video > How To Move a WordPress Website to a New Hosting Environment
In case you’re more of a watch-er than a read-er, I put all of the stuff above into the video below!
Featured image credit: Justin Morgan on Unsplash
Want to learn a bit more about WordPress databases?
Check out part 2 of our series!
. . .