Share this Post
Switching web hosts is not always straightforward.
But, there can be very good reasons to do so.
You might want to boost your site’s page-loading speeds
Loading speed is one of the key features we always track when reviewing hosts as well as support systems and its security.
With a wide selection of plan types available, owners should be prepared to adjust to changing circumstances.
Question is, how do you transfer your website from one host to another? We've got you covered.
Ten minutes planned is one hour saved in execution. Make sure you have these:
Logins to both web hosts
Important details are needed, plus the ability to make alterations to both accounts. Get your login details in order. If you can access, you are good to get going.
An FTP client (use any)
This will be an essential. We will use this in multiple steps., transferring information between FTP servers. For this, and FTP client is necessary, e.g. Cyberduck.
Code / text editor
This is the way we will make changes to codes In the relevant files. There are many free options, e.g. Notepad++.
Finally, we will need access to databases for your hosting website. This can be found in the admin section of the account.
Ready? Good stuff, then time to get moving. We’ll switch hosts for your WordPress website or other website builder in a jiffy.
How to (Manually) Switch Your WordPress Site To a Different Host
1. Get Your Site Backed Up (Demonstrated) 🖿
Let's remove any anxieties about making a critical mistake while migrating. We're going to backup your WordPress website.
This is actually the longest part of the whole process. First things first, get into your FTP server.
Enter account information into the FTP client. Once you're inside, search for your site’s root directory.
Check all the folders.
There may be a few files hidden by the FTP client. One of these is “.htaccess.” To overcome this, head to the menu heading called Server. Scroll down until you find the option for Force Showing Hidden Files.
Now that you’ve selected all of the files needed, we’re going to make a copy of these onto your computer hard drive. While we wait, let's get into databases.
2. Export Your Database
With directories being copied, we need to handle the very important database component of your site. Typically, it’s in phpMyAdmin:
On the left-hand side, you will see different database names. If you're unsure what name to select, check with the website you want to move from.
The wp-config.php file will give you a name, after the line reading “define.”
Now you know the name of your current website’s database.
Select those files and head to the Export section.
Change the Export Method from Quick to Costum. Also change these things:
- Output Tab - Select zipped or gzipped to compress, which will speed the download
- Tables Tab - Select the tables that need to be exported. Usually it will be all
- Data Creation Tab - Mark these: function, event, trigger, procedure, prodecure, add drop table
- Format - Should be SQL
3. Setting Up a New Database
OK, we’re headed towards the new host now, armed with database credentials. Log into your new host, using your account info. Go to the MySQL databases area.
Next three steps:
- Make a database
- Make a database user with full accessing privileges for that database
- Set up a user password
We’re going to build out the new database, so ensure you have these. Also, get your MySQL server name (usually localhost). If not, check with your host.
4. Make Config.php Changes
Let’s assume the files for your current site are done downloading. If not, when they are, head to where they are saved (inside the wp-config.php file).
This file plays an important role in transferring information between your website's database and file systems.
Before we do anything else, make a duplicate of that file. Place it somewhere safe in your hard drive. Now, open the original using the text editor. Find this section.
Replace this part of the third line, database_name_here, and the seventh’s password_here with your database name commands admin username, and secure password that we asked you to make earlier.
Switch Web Hosts for WordPress Tip2
The database_name_here will not be shown on your screen. You'll see information regarding your current web host. This is fine. Insert your MySQL server name where localhost is. If your hosting provider does use localhost as its server name, leave it as it is.
Now, save the file!
5. Migrate Website Files To Your New Web Host
Okay, we now need to take that exported data and store it on your new dedicated web host (maybe not). Firstly, place those files onto your new provider’s server. This will also take a while to compete, so we will go to other steps during.
Same as before: Open up your FTP client, but now connect it to your new host server. Typically, we would just paste in your website's URL… But as it's still pointing to your current server, this won't be effective.
Instead, we're going to fiddle with IP addresses as the aiming point. This will be somewhere in your new hosting account. But, you can always talk to the technical team if you cannot locate it.
Once you have triggered sending those files onto the server’s root directory - also make sure that the edited wp-config.php file is included - let that run its course and head to the next stage. While you’re at it, check if a good free VPS host is better than the one you’re looking at, though switching plans is simple, unlike a migration.
6. Time To Upload the Database
No rush. We're going to upload the database into your new host server. Log in to your new database admin area. Once again, this should also be phpMyAdmin.
Mark the database you made a few steps ago and select the Import tab.
We’ve highlighted in red where you should click, to choose your previously exported database. Once done, click the Go button.
Now that the import is starting, we have to wait. The time it takes will depend on how big your database is.
Are You Changing Your Current URL? (If So, You Must Do This!)
This section is optional. If you want to transfer a site - as well as replacing your current URL - you need to follow this step. We're going to be editing any database elements that refer to your current URL. We will replace those with the new URL.
There is more than one way of going about this… One of the simplest is the Search Replace DB Script. Download this automated plugin into your website's root directory. (inside a secret folder). Now, locate it in your browser.
Straightforward stuff. Enter your old and new URL info into the relevant fields. The rest can stay the same. First, do a dry run. If it looks good, do the live run.
Switch Web Hosts for WordPress Tip 3
This is a particularly explosive script. Remove it from your server, once the replacement has successfully been completed. A malicious opportunist could use this script to do serious damage to your site, if they located it… Also, an alternative to this tool is SQL Commands, should this tool not work.
7. Edit Your DNS Server Settings
Next stop shop is to point your URL towards your new server. For this, we will need to get into your DNS server settings.
Where was your domain registered? If you purchased it or was given it when you signed up with your current hosting provider, the best thing to do is to transfer your domain to your new host in its entirety. Your support team should be able to help you with this.
If you obtained it via a domain registrar such as NameCheap.com, make edits to your nameserver settings there. First, find the nameservers for your new provider. The format should look at follows:
By entering these into your domain registrar, they will point to - or become connected with - your new host. If you're not sure how to do this, have a quick search for your web host’s knowledgebase.
Remember, the support team is there to assist you. Once you have made those edits, it can take up to 72 hours for changes to be processed. It’s usually much faster, though.
Be aware that, if you make any edits to your website meanwhile, you will be editing a ghost, rather than the new server location
The moment that the two have been connected, there should be no issues with uptime. And, because your new website is a replica of the old, your visitors will not notice.
Switch Web Hosts for WordPress Tip 4
Have your DNS connection changes been processed - and are the domain/host connected to each other? Use the tool What's My DNS, to see.
8. Tying up Loose Ends
You successfully made the switch. Now that the DNS is pointing its way towards your new server, head back into your old web hosting account and delete your website database and files.
The most important thing is to make sure you have copies of the original wp-config.php file. If there is some issue with the migration, these will be majorly handy.
Switch Hosts By Using the WordPress Plugin
(Automatic, Not Manual) 🤖
Now for the easy solution to site migrations. Do all of the above in less time, by using a plugin. This automatically carries out the same processes. One excellent tool is the Duplicator plugin, which is free.
1. Grab Duplicator
Okay, find the plugin by first logging into WordPress. Look in the WordPress plugin directory on the dashboard. Click Add New, to find new plugins, and search the name up. Then click Install Now, once you locate it in search results.
That looks like it. Once the download is complete, click Activate and it will be functional.
2. Export Your Current Website
Once you have installed Duplicator, it will appear as a new option on your admin/dashboard menu. Select it and you will be lead here:
The plugin will save your database files in what it calls packages... For now, there is no list. Let's populate it with something. Select Create New in the upper-right section of the plugin - and we are in action.
Now you've got a list. Here are what the sections mean:
Here, you can enter in your database credentials that relate to your new server. We won't be doing this yet.
This section allows you to deselect certain files and elements of the database, preventing them from being migrated. Only use this if needed.
Edit where your backup files are stored. Unless you have the premium version of this plugin, your only option will be to store inside your new server.
Most commonly, you can just select Next. An automatic check will be run on your system, to see if there are any errors. At the end, there will be a summary.
Looking okay? If you see lots of greens and “Good” messages, you are … good to start exporting your database. Once successfully done, after a few minutes, you should see the screen.
Now, click the one click download link, to automatically download both the archive and installer. Good work!
3. FTP File Upload
These files need to be uploaded to your new server. We need the IP address, not the domain, to make that connection.
Connect to the FTP plugin and grab the archive and installer file. Insert them into the root directory, checking that there's nothing there already.
4. Make a Second MySQL
Though we are using a plugin, we still need to create a MySQL database for your new site. This will be what WordPress talks to… Head up to the relevant section in the manual part of this guide, to see how you can handle the new database creation, username with full privileges and secure password.
Switch Web Hosts for WordPress Tip 5
Keep a record of your database information. This will be needed at a later stage!
5. Get the Domain To Talk To the New Host
Things get a little bit tricky here. You need to get into your server files by using your web browser. You can usually do this by entering in your domain name..
If you intend to use your current domain name with your new host, you need to make the domain points to that server. We could create a new domain, to avoid this. Though, that would put your website down for a period of time.
A neat little solution is to use the hosts file on your computer (covered below). This is a little bit technical, but you are essentially using certain IP addresses to gain entry onto your new server, through your current domain. And doing it without downtime.
(Note: You can ignore this section in its entirety if you are getting a new domain.)
For those who are keeping their domain, let's get the IP address for your new host. Ask your support team if you can't locate where this is.
Now, let's get into the host’s file. Different platforms have different ways of doing this:
Mac OS & Linux platforms
Open up the command terminal and type the following in: sudo nano /etc/hosts. It might also prompt you to enter in an admin password.
Open up the taskbar. Look up “notepad.” Rather than opening it, click “run as administrator.” Once inside, use notepad to bring this up c:\windows\system32\drivers\etc\hosts. Make sure you search for “all files,” so that you can see this one in particular.
Now that you are inside the file, input the two IP addresses that you grabbed previously, and also the domain name, e.g.: 220.127.116.11 http://yourwebsite.com.
Once this is saved, your domain name and server should be connected. Which means the domain is being powered by your new web host.
Switch Web Hosts for WordPress Tip 6
The gap you see between the IP address and your url is not a normal space. Press tab on your keyboard instead. the IP address shown is just an example, make sure you use your actual server address. And the website should be whatever your domain name is.
Make sure: Upon completing your transfer, return your hosts file back to the way it was before making alterations.
6. Use Duplicator To Migrate
We're not done yet. In fact, the migration is only now really taking place. Type this http://yourwebsite.com/installer.php into your browser, and you should see this:
Once you see the green “pass” signs for validation and archived, check terms and conditions. Then click Next, which takes you to the deployment stage.
Now, you need to enter in those three components we spoke about earlier: Your admin username, admin password, and database names/host.
Get that information, which you should have. Do a dry run by selecting Test Database. If it's working fine, click Next, and your database will be imported in earnest.
Now, we may need to swap out your current URLs for the new directories (hopefully not, and they look correct). Check links, make sure all URLs are where they should be.
We are into the final stretch! You are given a hyperlink that will take you to your website directly. There's also a summary telling you if there were any errors. If you see greens, then the transfer was successful. If you are given any notices, give them a look.
7. Make DNS Nameserver Changes
There is one final step to getting your domain name to talk to your new server.
This was mentioned in an earlier section, so she glowed up. Essentially, you need to get your new host’s nameserver addresses. Input into your current domain. This makes the domain point or connect to that server. But there is a waiting time.
Once finished, you have successfully completed the migration process! You should now have a much stronger idea of how this process works, than the average person. This will serve you in good stead. Hoorah!
Summary of the Migration Process for WordPress Websites
The Short Story 📖
There's no doubt about it, migrating your WordPress website from one host provider to an alternative can be a challenge. This is especially the case for newbies. We recommend keeping a close eye on steps and sequences, to break down each stage.
We prepared the list of the best WordPress backup plugins to help you backup your website before migrating.
Assuming you have successfully completed each step, your website has now migrated from your previous host to your new provider. Whether you did this via manual means or using a plugin, here are the basic steps taken - as a reminder:
- Backup your website database and crucial files
- Set yourself up in your new web host ready for migration
- Export and upload your database and files to your new provider
- Finally, input your new providers nameserver infos into your domain
And that's about it. Well done once again for getting through this guide. Great stuff!
Remember to choose your host carefully. If you’re really at a budget, consider a top free web host.
Is there something that wasn't covered in this switching WordPress web hosts guide? Drop us any questions you have in the comments below .