Are you willing to migrate your WordPress website from a host to a new host or server?
It is such a daunting and stressful experience, but don’t worry.
We will dive in and explain to you how to migrate your WordPress site by following our guide to succeeding in doing it.
Bear in mind that migrating is not a problem if you spend some time preparing your own website. If done correctly, it can be very simple, and should anything go wrong, it can be quickly undone.
Before we start showing you how to migrate your site, keep in mind that many of the best WordPress hosting providers will move your site.
If you have recently bought a new hosting plan and want to move your site, check with your new hosting provider to see if they offer this service.
Step 1: Select a New WordPress Host
It’s crucial to make a wise choice when looking for a new WordPress hosting provider so you don’t have to move anytime in the near future, especially if you encountered a slow web host despite optimizing WordPress speed and performance.
We recommend going with HostGent for reliable shared hosting. By using our host, users get 15% off and a free domain name.
Do not install WordPress after purchasing new hosting. We’ll get to that later.
Your new web hosting account needs to be entirely empty for the time being, with no files or folders in the primary directory.
Step 2: Make a Backup of Your Website’s Files
Making a backup of every aspect of your site is the first thing to do before a migration. This should be done as part of your overall WordPress security and is recommended before making any significant changes.
However, given the amount of data being moved, it is also important for migrating your WordPress installation.
You may be asking, ” How do I back up my website files?” You can use a variety of plugins to back up WordPress for you.
The only thing you need is a backup plugin, which you usually install and then use settings to manage which files are backed up, the frequency, and where they are stored.
We at HostGent highly recommend Duplicator, which is a free plugin. Here is the good news; it can also be used to change the domain name of your website without losing SEO.
When the Duplicator is installed and ready to use, navigate to the Duplicator Packages page on your WordPress admin page.
In the top right corner, click the ‘Create New’ button. Then, click the next button and proceed with the steps to create your own package.
Check that the scan results are “Good” before clicking the Build button. Keep the tab open while the plugin works because the process could take a while.
You’ll be able to download the installer and the archive package once the process is finished.
To download both files, you need only to click the “One-click download” link. The installer file will operate installation automation for you, and here you have the archive file containing a copy of your entire website.
Step 3: Move Your WordPress Site to Your New Host
The next step is uploading the archive and installer files to your new web host. This can be done by using an FTP connection to your new web host.
When setting up a connection with an FTP client, you should enter your website’s domain name as the host.
You should still connect by entering your server’s IP address or hostname because your domain name is still directing traffic to your old host. This data is accessible through the cPanel dashboard of your new hosting account.
You need to upload your archive.zip file and installer.php file to the root directory of your website using an FTP client. Normally, it is in the /username/public html/ folder.
When you sign up with some web hosting providers, WordPress may be installed without your knowledge, so make sure your root directory is empty.
You should first remove WordPress from your root directory if it is installed there.
After that, you have to upload the installer.php file and the archive zip file to the root directory of your website.
Step 4: Modify the Host Files in Order to Prevent Any Downtime
You should open the installer.php file in a browser after you’ve uploaded both files to your new host. This URL will take you to the file: http://www.example.com/installer.php
On the other hand, you will experience a 404 error and be redirected to your old web host if you use this URL. This is due to the fact that your domain name is still directing people to your previous web host.
Do you want to temporarily access your new site on your computer without having an impact on your old site?
Then, continue reading to find out how.
Domain names can be mapped to specific IP addresses using the hosts file. So, it allows you to mislead your computer into believing that the website has been moved when it hasn’t.
In order to point your domain name to your new hosting provider, we now need to add an entry for your domain name to the hosts file.
Once you’ve made these adjustments, you will be able to access the files on your new host using your domain name, while people will continue to access your site through the old host.
Finding the IP address of your new web hosting server is the first thing to do. You have to log into your cPanel dashboard and select the “expand stats” link from the left sidebar.
This will take you to a list where the address of your server will be displayed as “Shared IP Address.”
Windows users need to right-click Notepad and choose Run as Administrator in the following step. To do that, you have to go to Programs > All Programs > Accessories.
You will see a Windows UAC prompt; you need to select Yes to launch Notepad with administrator rights.
Move to the C:\Windows\System32\drivers\etc folder from the Notepad screen by selecting File > Open. Select and open the hosts file from this folder.
Are you still following me? Keep going…
Now, you have to enter the IP address that you copied from the hosts file’s bottom, followed by your domain name.
It should be like this: 192.168.1.22 www.example.com
Put your own domain name in place of example.com and the IP address you copied from cPanel.
You can now use your computer’s domain name to access your files on the new host.
Note: After the migration is complete, remember to reverse the changes you made to the hosts file.
Step 5: Making MySQL Database on Your New Host
We must first create a configuration for a WordPress installation before starting the migration to the new web host.
All you need to do is to import your SQL data, but you must first build a database.
Creating a database involves just a few straightforward steps:
- Create a new database for your website by opening MySQL database and giving it a suitable name.
- Make a new MySQL user and give it a strong password.
- Make sure to give this user account all privileges and add it to the new database.
The username, password, and database name should all be written down. That information will come in handy later.
Step 6: Start the Duplicator Migration Process
Replace example.com with your domain name and enter the following address into your browser window:
http://www.example.com/installer.php
A few tests will be run by the installer, and you will see ‘Pass’ next to the archive and validation tests. To proceed, you have to select the Terms & Conditions checkbox and then click the Next button.
You will now be prompted to enter your MySQL hostname, database name, username, and password.
Your host will most likely be a local. Following that, you’ll enter the database’s information that was created in the preceding step.
If you’re unsure whether you entered the data correctly, click the “Test Database” button.
You will see a string beginning with “Pass” if the Duplicator is successful in establishing a connection. If not, details of the database connection error will be displayed.
Now, to proceed, click the next button. Now, Duplicator will import your WordPress database into your new database from the archive zip file.
You will then be asked to update the site URL or path. You don’t need to make any changes here because you aren’t changing domain names. Now, click the next button.
The login button will appear after the Duplicator has completed the last few steps.
Now that your WordPress site is hosted on the new server, you can log in to check that everything is operating as it should.
Step 7: Reconfigure Your Domain’s DNS Settings
You have to update the DNS settings for your domain before you can access the site on your new host. You also need to change the correct records to point to the new server’s IP address because they will already be configured to point to your old host.
Where you registered your domain will affect this procedure. You should have all the information needed to make this change from your domain registrar.
Up to 48 hours may pass before DNS changes take effect completely. The ideal time to do this is when you expect to have less traffic. You shouldn’t do anything to alter your website during these 48 hours since you might be altering an older version of the site.
When you visit your website after the 48-hour window has passed, you will see the new web host. You can connect to your previous web host and remove the files and database.
There is still a need to keep a local backup copy of these files and the database export with the original wp-config.php file if you want to undo the migration.
We also recommend that you wait 7 days after your migration to cancel your old hosting account.
Conclusion
The migration process isn’t a challenging process. All you need is to take caution at each stage and keep that option of reverting to the original version available till the very last second in case there are any problems.
Do you want to move your WordPress website? Let us know if you have any questions by contacting us through our Live Chat Support.
HostGent offers a variety of technical services tailored to your specific needs.