There are plenty of companies that can host your WordPress website. Choosing the best one for you blog can be a daunting task. The Internet is full of reviews which won’t be much of help. So, when you started your site, you had to choose a web host. And now that you have realized that the host isn’t good enough for you, you simply needed to upgrade to faster one, or you finally decided to move from the free hosting solution to a premium one, the problem arises. You need to migrate WordPress site to a new web host.
Just with the sound of that, many beginners will start panicking. Do you have to know a programming language? Do you have to set up a server on your own? What are the chances that you will lose your site during the migration process? If you have thought of any of those or similar questions, stop now.
To migrate WordPress site to a new web host even for the first time, you just need to follow a few easy steps, and you can do it on your own. In this article, we’re about to show you how to migrate WordPress site manually and by using a plugin. Take some time, and after successfully completing the migration, you’ll start doing this for your friends in no time.
Table of Contents:
- Migrate WordPress site manually
- Migrate WordPress site with Duplicator
Migrate WordPress site manually
Before you decide it’s not worth doing all this on your own, glance at the steps below and you should realize how easy things really are. You should take things slow and do one step at the time. Let’s go.
1. Backup the entire site
Apparently, in order to move the files to a new location, you will first need to download them on your computer. You can either follow the simple steps and backup your WordPress site manually, or you can use any of the WordPress backup plugins. If you have already done a manual backup, here’s just a quick recap:
- Login to FTP account with a client like FileZilla
- Make sure that you select all files (even the hidden ones)
- Download the entire WorPress folder to your computer
Remember that you’re downloading the entire site. Depending on the media files you have on your website and your Internet connection speed, this might take you some time to complete. After the download is finished, check your folder and make sure that your files are actually in the place.
Don’t cut or delete the files from your old host. This will ensure that your website still functions properly while you’re doing the migration process.
2. Backup the database
After your files are safely placed on your local computer, it’s time to export the WordPress database. You will need access to cPanel after which you’re just a few clicks away from having the database on your computer:
- Log in to your cPanel
- Navigate to Databases category
- Open phpMyAdmin
- Choose the Export tab
- Select a method (quick or set options in the custom method)
- Pick a format for the database
- Click Go button which will save the database on your computer
3. Create a new database on a new host
Now that you have both the database and your files backed up, you are ready for the work on a new host. Before you can install WordPress on a new host, you will need to create a new database.
- Open cPanel on your new host
- Navigate to MySQL Database
- Create a new database
- Create a new MySQL user
- Add new user account to the newly created database (make sure the user has all privileges selected)
- Copy database name, username, and password which you will need for the next step
4. Prepare the wp-config.php file
This is the part where you start preparing things for a new host. As you may recognize from the name of the file, wp-config.php is in charge of the configuration of your site. It connects your WordPress installation with the databases and makes sure that everything works fine.
Now that you know that, it’s obvious that the file needs some changes. Don’t worry; you already have all the necessary info from the last step.
- Open the WordPress folder you backed up earlier
- Make a copy of wp-config.php file just in case you do something wrong
- Open the wp-config.php file and locate the following code:
- Change the database name, username, and password to newly created ones
- Save changes
define('DB_NAME', 'your_database_name'); /** MySQL database username */ define('DB_USER', 'your_user_name'); /** MySQL database password */ define('DB_PASSWORD', 'your_password');
5. Import the database to new host
Let’s import the database so it can connect to your new WordPress installation.
- Open cPanel on your new host
- Navigate to PhpMyAdmin
- Navigate to Import tab
- Choose the database file you previously backed up
- Make sure the checkbox in Partial Import is unchecked
- Click the Go button
6. Upload the files
You’re almost done with migrating your WordPress site to a new host, so stick with us for a few more minutes. After the database is up and ready, you still need to upload the entire WordPress folder you previously downloaded. To upload it to the new server, you should repeat similar steps:
- Login to your FTP account
- Find WordPress or public_html folder
- Upload the entire WorPress folder from your computer
Usually, upload speeds are way slower than the download ones. Be patient and allow the transfer to finish. Voila! You have successfully migrated your WordPress site to a new host!
7. Configure DNS settings
Although you have successfully migrated WordPress site to your new web host, you’re still not done. If you leave things at this step, your domain will keep trying to load a website from the old host. That’s why you need to reconfigure the DNS settings and tell the name server that you moved your site to another location. Unfortunately, this might be the most complicated step, but you can’t give up now! Let’s change that name server details.
Unfortunately, every registrar and service are a bit different, and it’s not possible to create a step-by-step guide for each scenario. To keep it simple, we’re about to follow the same example as in the video above. We strongly suggest that you watch the video because it will make things much clearer to you.
Let’s say that you’ve registered your domain with GoDaddy, and you’re migrating your WordPress site to Hostgator. After all the previous steps, you now have to change DNS settings.
- Login to your GoDaddy account
- Navigate to Domains and click the green Launch button
- Choose your domain from the list
- Navigate to Nameservers and click the Manage button
- Locate the information from Hostgator (or any other host you’re using)
- Choose the Custom option
- Click the Edit Nameservers
- Change both Nameservers to new ones
- Click OK and save the changes
The information about nameserver will look something like this:
Take note that DNS changes can take up to 48 hours to fully propagate.
Changing the DNS settings takes a while. Usually, the changes will take effect after 24 hours, but it may take you even up to two days before everything gets to its place. There’s nothing you can do to speed things up, so you’ll just have to wait. Make sure that the Nameservers are correct and start the stopwatch.
If you are not certain where to find the needed information and how to do this, contact the support of your new web host, and they will help you to reconfigure DNS settings correctly.
Migrate WordPress site with Duplicator
If you are in a search for an easier solution where you won’t have to do all the steps manually, continue on reading. As you may have expected, some plugins can migrate WordPress site for you.
With almost one million active installs, Duplicator is definitely the most popular plugin for the job. The name of the plugin tells you that it can duplicate your site; whether you want to migrate WordPress site from your local server, or you want to move it from one host to another, the plugin will help you do that. It can even serve you as a backup plugin. Since Duplicator supports both serialized and base64 serialized string replacement, you won’t have to worry about missing data after the migration process. Duplicator will take care of everything.
1. Export your site
Before you can move the site, you will need to create a backup. Instead of manually creating a backup of your files and the database, Duplicator will quickly prepare everything for you.
If you encounter any errors, don’t worry. The plugin will scan your site for all the necessary files, and it will let you delete large media files that you might not need anymore.
- Install and activate the plugin on your existing host
- Go to Duplicator -> Packages -> Create New
- Fix any errors if the plugins points you to them after the scan
- Download Installer and Archive files
2. Import your site to a new web host
If you’re really in a rush, you may continue with the migration while Duplicator is still downloading the original site. Please note that Duplicator doesn’t require you to install WordPress on a new website, but you will still have to create a new database. Please scroll up and see how to create a new database on a new host.
- Create a new database
- Connect to your FTP account
- Upload both Installer and Archive files to the root folder
- Go to yourdomain.com/installer.php
If you followed the steps, now you should see an Installer page which will guide you through the rest of the migration process. Here you should enter info about the new database that you created in the previous steps. Test the connection, and if everything is ok, you will be able to proceed with the installation. Change the URL if necessary and add other details. After that, Duplicator will show a report card and display errors which hopefully there won’t be many.
The last step is to open your FTP client once again and delete the Archive file. Also, in some cases, the Installer file will still be there, and you can now delete it.
Your WordPress site is now successfully migrated to a new host. But just like with the manual method, you will still have to reconfigure DNS settings.
We hope that this article helped you migrate WordPress site to a new web host. Hopefully, things were simple enough for you and there weren’t many problems on the road. Now that you’re done, you realize how simple the whole process actually is, isn’t it?