You might need to move your website to a new host for several reasons. The majority of users find migrating their WordPress site to a new host a challenging process. As a result of issues with their existing host, many people are forced to switch to a different one. However, the process of migrating a WordPress site to a host with greater reliability is frequently put off out of fear of making a mistake that will render the site inoperable. People will either pay a WordPress developer to move their site for them or find a hosting platform with free or paid migration site service as part of a new hosting package.
If your new hosting service does not include a free WordPress site transfer as part of the package it offers, I suggest you perform the transfer on your own. I will walk you through the process of migrating your WordPress site to a new host.
There is no need for anxiety regarding migration if it is approached in the right way. Before doing anything like migration, you must first ensure that you have a recent backup of your WordPress site. When migrating a WordPress website to a new host, there is a chance that data will be lost and the site will be unavailable for a period of time. This article provides detailed instructions on migrating your WordPress website safely and without disruption.
Migrating Your WordPress Site to A New Host
There are 3 ways to migrate your WP site to a new host. We will discuss them in detail
- Migrate Your WordPress Site Manually
- Migrate Your WordPress Site using a Plugin
- Let your New Host do it for you.
Things to do before starting Migration of the WordPress site
Consider your timing
It’s important to migrate your site at a convenient time and date. It should be when the fewest people visit your website. You can use Google Analytics to determine the times of day when your site receives the fewest visitors.
You May Also Like: Best Blog Hosting Sites
Put your site on hold.
When you back up your WordPress site before migrating, everything you do on your website after the Backup is not transferred to the new host. So put your site on hold.
If you operate an eCommerce store, temporarily suspend orders. Put off posting new content if you’re a blogging site. Ensure that you inform your employees to do the same. Consider using a pop-up or banner to inform site users and clients that your site will be momentarily unavailable for maintenance.
Ensure you have a backup
Ensuring that you have a full site backup on hand is an absolute necessity
We will talk about it in more detail in the migration process.
Now Let’s take a look how to Migrate a WordPress Site to a New Host
1. Migrate Your WordPress Site Manually
This might look a bit daunting, but if you follow the steps, I can guarantee you will have no problem doing it.
Back up Your Website’s Files
It is crucial to back up all of your website’s files to your local computer. This applies to everyone, even if your new hosting company is migrating your website for you, as backups are an essential safety precaution.
You May Also Like: Bluehost Review – Cheap WordPress Hosting for Bloggers
Use file transfer protocol client to Backup.
A File Transfer Protocol client (FTP client) is a piece of software that connects a host computer to a remote server, often an FTP server. The host computer is the client in an FTP client’s client/server architecture, whereas the remote FTP server is the central server. An FTP client facilitates the bidirectional transfer of data and files between two computers via a TCP network or the Internet. We recommend using Filezilla FTP.
After installing an FTP client, you will need to use Secure Shell FTP (SFTP) credentials from your former hosting account in order to connect to the server and access your files. After connecting to your site’s server via FTP, navigate to the WordPress root folder, which contains all of your site’s files. It is typically titled public_html, www, or the name of your website.
Select the Download option by right-clicking on your root folder. The complete root directory will be downloaded to your local machine.
Backing Up and Exporting Your WP Database
Your next step is to create a backup of the site’s database. All the data pertaining to the site’s content, users, and other aspects are stored here.
Backing Up and Exporting Your WP Database using phpMyAdmin
If your host doesn’t provide phpMyAdmin, they might use Adminer or another tool for managing databases instead. Regardless of the case, the procedures are essentially the same. The complete database must be exported as a SQL file. I will show you how to do it using phpMyAdmin.
- To access phpMyAdmin: Go to your site’s web host’s cPanel and locate phpMyAdmin in the database section.
- Find the appropriate database: Click the Database button. Choose the database that you wish to export. Look for the database’s name in the wp-config.php file to determine which database to export.
- Export the files: Select every file and then Click Export; choose Quick as the kind of export and SQL as the file type. Click on “Go.”.
You May Also Like: WordPress Plugins for Business Websites
Backing Up and Exporting Your WP Database using SSH
Using SSH, you can also export the database to a SQL folder. To do this, you will need to have WP-CLI installed.
Use SSH to connect to your site server. Most of the time, the credentials will be the same as the ones you use for FTP.
Navigate to the file wp-config.php: This is probably located in the public_html directory. Run this command to do this:
cd applications/<your_application_name>/public_html/
In the line above, replace <your_application_name> with your database name.
Export the WordPress database using this command
wp db export mysitefiles.sql
Replace the mysitefiles with an appropriate name for your database to export.
This will save your file to your local machine.
This will complete the process.
Creating MySQL Database on Your New Host
It is necessary for us to prepare an environment for a WordPress installation before we can move forward with the migration to the new web host. In order to accomplish this, you will need first to create a database into which you can import your SQL data.
You May Also Like: Signs that you need a Developer for your WordPress Website
Creating a Database using cPanel
Go to the cPanel dashboard for your new hosting account, scroll down to the Databases section, and then click on the icon labelled MySQL databases.
You will see a box where you can enter the details for a new database. After giving your database a name, click “Create Database.”
After the MySQL database has been created, you will need to get to the MySQL Users section by scrolling down the page.
Click the ‘Create a user’ button after entering a username and password for your new user.
After that, you will have to add this user to your database. When you do this, the newly created user will have complete control over the database.
You can accomplish this by scrolling down until you reach the section labelled “Add User to a Database.” Simply select the database user you created from the dropdown menu next to user, then select database, and click on the add button.
Creating Database Using WP-CLI
You can create a new MySQL database using WP-CLI by following these steps:
Log in to MySQL as root to create a new user using this command.
mysql -u root -p
Simply enter each command line written below to add a new user and database:
CREATE USER ‘username’;
CREATE DATABASE ‘databasename’;
Replace username and databasename with names you prefer to add.
Give the user full permission to change the database using this command line.
GRANT ALL PRIVILEGES ON databasename.* TO ‘username’ IDENTIFIED BY ‘yourpassword’;
Database and username should be the same as the one you created earlier, and change yourpassword to the password you want to create.
When you’re done, you can log out of MySQL by typing:
quit
Your database is now WordPress-ready. Be sure to jot down the database’s name, username, and password, and keep all of this information secure. You are going to need this information.
You May Also Like: Best WordPress Tools For Maintenance
Editing the wp-config.php file
Navigate to the folder on your local computer where you saved the website files you downloaded. There is a file called wp-config.php in that folder.
Please make a copy of this file and put it in a different folder on your local computer. We need to do this so that we can undo the changes we are about to make if something goes wrong.
Open the original file in your preferred text editor and make the three changes below:
Change the Database Name
Find this line
define(‘DB_NAME’, ‘db_name’);
The db_name variable presently contains the MySQL database name from your previous web host. Replace this with the name of the database you just made.
Change the Database Username
Now you will have to edit this too
define(‘DB_USER’, ‘db_user’);
Here db_user will have to be updated with the new database username
Change the Database User Password
Finally edit this one too
define(‘DB_PASSWORD’, ‘db_pass’);
Here db_pass will have to be updated with new database password
Now save the changes and close the wp-config file.
You May Also Like: Migrating from Shopify to WooCommerce
Importing To new Database
Using PhpMyAdmin
Sign in to the phpMyAdmin of the new site. Go to the new database you created. Go to the Import tab in the new database and upload the SQL file you created earlier.
Using WP-CLI
Transfer your file to the target directory where the wp-config.php file resides. By default, it is located in the public_html folder.
The command below will enable you to upload your MySQL/MariaDB database to the application.
wp db import myfile.sql
Replace myfile with the name of the SQL file you exported.
Upload Your Site’s Files to the New Web Host
The next step is to upload your website’s files now that the new database is ready and the wp-config.php file has been modified.
Start up your FTP client, connect to your new web host, and navigate to the folder where you’ll be storing your website files. If this is the only site installed on this web server, the public_html folder is the normal location for file uploads.
Now that the remote directory has been selected, you may upload your website’s files, which should include the updated wp-config.php.
Once the upload is complete, do not remove these files from your local computer. They’ll be required until the very end.
You May Also Like: What is WordPress Multisite
Update Your Domain Name Server
Once you are certain that the migration was successful, you will need to modify your DNS settings to point your domain name to your new server. This procedure varies depending on your provider, but the common steps are as follows:
Log in to your domain registrar or DNS provider and navigate to the section where you may modify your DNS settings. Again, this will depend on your service provider, but they should provide detailed documentation.
Change the A record to the IP address of your new server. The precise steps to take depends on your service provider. Additionally, you can always ask your provider to make this change on your behalf. Do not remove, update, or delete any other DNS settings unless you are confident they are no longer required.
Once your settings have been saved, you must wait for the DNS to propagate. Changes to the DNS might take up to 48 hours to propagate globally. Because of this, you should not discontinue your old hosting until you are certain that propagation has concluded. With tools such as DNS Checker, you can verify propagation.
You May Also Like: What is Full Site Editing
2. Migrate Your WordPress Site using a Plugin
It’s helpful to know how to migrate a WordPress site manually. However, as we mentioned before, several plugins are also available to make migrating WordPress sites easier. Here is a list of a few well-known plugins. We won’t be discussing the actual process of using these plugins because they have great documentation on how to use them.
Duplicator
The Duplicator plugin is one of the greatest solutions if you want to automate the full migration process. It is compatible with any WordPress installation and will copy your database and all associated files for you. A few manual steps are still required to set up your website on its new host, but the general procedure is considerably simpler.
All-in-One WP Migration
Among backup and migration plugins for WordPress, All-in-One WP Migration is among the simplest to use. In a matter of minutes, you can make a copy of your site that you can then import to another WordPress installation.
BlogVault
When it comes to migrating and creating backups, BlogVault is a reputable brand name. It’s one of the most efficient and effective WordPress migrating plugin that is currently available. The plugin has helped in moving websites for nearly a decade and has done over a million successful WordPress migrations.
UpdraftPlus Migrator
Although it is best known as a backup plugin for WordPress, Updraft also provides migration services. Because the migration option is offered as an addition, you will need to purchase the additional package in order to use it. One of the nicest aspects of this WordPress migration plugin is the database tool, which removes all references to your former website from the database instantly.
WP Migrate DB
Much like All-In-One Migration, WP Migrate DB is designed to concentrate solely on migrating WordPress sites. This WordPress Migration plugin’s rich features make it an excellent choice for developers. It is important to keep in mind that the free version will just migrate the database. However, the pro version will move your entire site.
You May Also Like: Reasons to avoid Nulled Themes and Plugins
Let your New Host do it for you.
The migration of a WordPress site using this method is by far the simplest solution. However, the availability of this option will depend on the hosting provider you are migrating to.
Many managed WordPress hosting providers offer either a free migration service or a plugin that can be installed on your website to carry out the migration process.
This could take anywhere between one and three days.
Things to check after Successful Migration
Check your SSL certificate.
After completing the migration, verify that your SSL certificate is working. You can accomplish this by opening your website in an incognito window. Be sure to examine numerous pages, not just the homepage. If no security warning appears and a lock icon appears next to your URL in the browser, you’re good to go.
If it’s not working, double-check that you’ve installed an SSL certificate through your server, and if you need assistance, contact their customer service.
Verify that the site works as expected.
Make sure that every one of your pages looks good and works as expected by clicking through them. Make sure you’re getting submissions by filling out contact forms. If you have an online store, you should go through the whole checkout process and make sure payments work. You should make sure that all of the links on the site are working properly.
You May Also Like: What is Core Web Vitals (CWVs)
Test backend functionalities
Are your security checks active? Are you still hooked to your social media feeds? If not, try re-establishing a connection to your extensions or plugins.
Check site speed
Discover how quickly (or slowly) your site loads with the help of tools like GTMetrix or Google PageSpeed Insights. If things seem to be moving slower than before the migration, look into the hosting plan changes. Did your former host provide a content delivery network? With your new host, you may need to consider upgrading.
Put an end to your previous web host.
When you’re satisfied that your website is functioning as expected, you can terminate your previous hosting service. However, exercise caution. Please don’t cancel your service with that company until you’ve transferred all domain names or email addresses you use with them.
Average Cost of Migrating Your WordPress Site to A New Host
Since the cost depends on the method you choose, there’s no single average price for WordPress site migration. However, we can estimate based on the common options:
- Free: If you leverage your new web host’s migration service or use a free plugin, then the cost is practically zero.
- Paid: Here’s a rough estimate for paid options:
- DIY with paid plugin: $49.50 per year (Duplicator Basic)
- Professional developer: $80-$120 per hour
So, depending on your chosen method, the cost can range from free to several hundred dollars.
Final Thoughts
The migration of a WordPress site may appear to be difficult at first glance. However, the process will be much simpler if you are equipped with the appropriate tools and follow the instructions provided.
We have made an effort to provide you with all the procedures necessary to successfully migrate your WordPress site on your own.
If you need a professional WordPress agency to migrate your website to new host, contact Lime Street – a WordPress agency for SMBs.