Migrate WordPress Site To New Host: With And Without Plugin
- Last Updated: Mar 7th, 2019
- Posted by: admin
- Category: WordPress Knowledge
Migrating WordPress site to new host can be a stressful task! Basically, it is a process of migrating a WordPress site from one server to another without losing site performance. But by doing this you can have the possibility of damaging your site. However, most of the people migrate WordPress site to new host or server because of their current provider’s problems.
Further, during WordPress migration, the biggest risk that you can face is data loss and downtime. Both of these can harm your website, means, users and search engines cannot access your site. As a result, you can lose your potential and search engine ranking.
Furthermore, if you spend a few time creating your own site, so WordPress migration is nothing to be worried about. It is a very simple process if approached properly. That’s why here we have covered up this entire migration process within a few steps.
Thus, this is what we are elaborating here! Keep reading…
How to migrate WordPress site to new host
Following are the steps that will help you to migrate WordPress site to new server. Let’s have a look?
Step 1: Choose a new WordPress host
If you have tired up with a slow web host after optimizing WordPress speed & performance, so don’t worry, migrate your WordPress site to a new server by which you can grow your traffic.
If you are going to a new WordPress hosting provider so choose it very carefully so that you don’t need to choose again and again.
We recommend some hosting providers which are as shown below:
- For the reliable shared hosting server, we recommend you to move with the Bluehost. They are officially recommended by the WordPress.org.
- If you are looking for the cloud hosting or location-identifier providers, then we recommend you to check out Site domain WordPress Support. They have data centers and free support across three (3) different continents of the world.
- If you are looking for the dedicated server, then we recommend you to check out the InMotion Hosting server. They commercial provide class servers and their support is amazing.
Once you choose the best provider, it’s necessary to backup your site in order to save your site data.
Step 2: Backup your Website’s Files
[The image to illustrate the same is attached from the source – wpexplorer.com]
Back up each & every aspect of your WordPress site. This is the best practice before doing any major change, but it is necessary while you are migrating your WordPress installation.
Furthermore, you can also manually backup your site. Just connect to your web host using an FTP program such as FileZilla and copy all files under your website’s directory to a folder on your local computer.
It includes the .htaccess file that is set to be hidden. Just consult your FTP program help file to have it show hidden files if you are not able to see this file. This could take some time depending on the number of media uploads you have on your site. If you are facing any problem then feel free to avail our Backup and Restore Support Services.
Step 3: Export WordPress Database
Exporting your database is an easy process that only needs a few steps to complete. Just login to the cPanel account of your web server and open the phpMyAdmin application. Choose the database containing your WordPress installation from the list on the left-hand sidebar. After selection, click on the Export tab on the navigation menu.
The default settings of a quick export and the SQL format for the export are adequate for what we require. Tap to the Go button, the database export process will begin and a file will be downloaded to your local computer.
Step 4: Create a WordPress MySQL database on your new host server
Before starting to migrate WordPress site to new server, create an environment for a WordPress installation. To manually migrate your WordPress site you need to create a database by which you can import your SQL data.
Just log in to your new web host and connect to the cPanel software. Here we will be using the MySQL databases application. In case your web host doesn’t run this application, then contact their support team and ask a way to create new databases.
Following are the steps to creating a database:
- The very first, in your hosting account cPanel, open the MySQL database icon and create a new database with a suitable name for your website.
- Next, create a new MySQL database with a secure password.
- You have to add this user account to the new database. It will give you the username that you have created.
- Scroll down to ‘Add user to a database’ section and choose the database user that you just have created from the drop-down menu and then choose the database and finally click on the Add Button.
- Now you have successfully created your database with WordPress. Remember that note your database name,
- username, and password. You will require this information soon.
Step 5: Edit the wp-config.php File
To edit the wp-config.php file go to the folder on your computer where you downloaded your website files. Here you will see a file called wp-config.php that regulates the access among WordPress and your database.
Thereafter, copy this file and store it in another folder. In case something goes wrong, so you can restore your changes from here.
Now, again go to the original version of the file and open it and make the three changes that are as follows:
1. Change the database name
Navigate to the following line:
At present, you will have to set the db_name portion of the above line to the MySQL database name of your old web host. And this must be changed to the new database name that you have just created.
2. Change the database username
Find the given-below line in your file:
Here, change the db_user portion from your old host username to match the new username that you just have created.
3. Change the database user password
Go to the given-below line in your file:
Here, you will have to change db_pass portion to the new secure password that you have created for your MySQL users. Now save wp-config.php and close the file.
Step 6: Import Your Database
Now that you have a new database to work with it. So let’s start the import process.
To import the data, the very first you will have to launch phpMyAdmin from cPanel on your new server. After that choose the new database from the list on the left sidebar. And finally, click on the Import tab from the navigation menu.
Now click on the choose file button in the File to Import section and choose the SQL file that you exported previously.
After that, un-check the Partial Import check box. Remember that the format is set to SQL and tap the GO button. Doing this your import process will start.
The time depends on your database size. When it has finished you will receive a successful message.
Step 7: Upload your WordPress files to your new host
You have configured the wp-config.php file and prepared your new database, it’s time to start uploading your site’s file.
By using the FTP program, connect to your new web host and go to the folder where your site going to be held. In case this is the primary or only site being installed on this web server then uploading the files to the public_html folder is the usual directory.
With remote directory selection, upload your site’s files in which updated version of wp-config.php php file included. With the first download, this process can take some time.
Once upload finished, don’t delete these files from the local computer. They might be required until the final step have been completed.
Step 8: Linking to new URL and defining new domain
In case you migrate WordPress site to new domain name, then read this step otherwise you can skip it.
While migrating site most of the people faces issue that they’ve added links to other posts on their website and inserted images straightly by pointing to a URL on the server. And causing these to break when moved over to a new domain.
By using Search Replace DB script on GitHub, you can search easily for any instances of your old domain name and replace with the name. Remember that once you have done, then delete it (for security reason) and don’t keep it in your root domain. Create a temp folder with a random name to host the script.
Changing Site URL: By doing a search and replace the old domain with the new domain you can also change site_url and home_url values in your database. However, changing the site URL ensure that while you are trying to login on the new domain, it does not try and redirect you on your old domain.
Step 9: The Final Touches
In this step, there are two different things with potentially various days between them. Reconfigure the settings of your domain’s DNS before using the new host site. Because they will be set to the point of your old host and you will have to pint the right record to the new server IP address.
This process relies on where you have your domain registered. However, the registrar of your domain should have all the details that you need to make this change. Basically, all details which required to completing this process are too varied to discuss in this post.
Remember that DNS changes can take 48 hours to complete this process. If you expect lower levels of traffic, doing this is great at a period of time. Remember that during DNS changes means 48 hours window, don’t make any changes to your site because doing this can affect the old version of the site.
After 48 hours process, you will be accessing the new web host when you go to your site. Also, you can connect to your old web host by deleting files and database. Remember that you should have a duplicate copy of these files and database of original wp-config.php file.
That’s it! Now let’s discuss on how to migrate WordPress site with plugin.
Plugin to migrate WordPress site to new hosting
As we have discussed above in the first step, once you have purchased your new host, then don’t install the WordPress (blogging platform). We will do that in our later steps. Now, your new web host account should be completely empty with no files or folders in your main directory or attributes. Thereafter:
Setting Up Duplicator Migration Plugin
Duplicator migrate WordPress plugin is a free plugin and the best way to migrate WordPress site. We always recommend to all because by using this you can migrate your site with no downtime and without losing your site potential.
The very first install and activate the free Duplicator plugin on a website that you want to move to a new url. You can see our guide on How to Install a WordPress Plugin.
After you have installed and activated the Duplicator plugin in your cPanel, then go to the Duplicator>>Packages section in your WordPress admin area, which we arrive in this blog step.
Now, go to the top right center and click the “Create New” button.
[The image illustrated below is attached from the source – wpbeginner.com]
Thereafter, click the Next button and follow the steps to create your packages.
Remember that check out your scan results (each & every button should good) and then click on the Build button.
This process may take several minutes to complete down the process, so leave the tab open so that plugin does its task.
After completing the process, then you need to download both the Installer and Archive package, click the “One click download” link and download both files.
The archive file is the entire copy of your site, and the installer file will automatically the installation process.
Import Your WordPress Site to New Host
Now you have downloaded both the archive and installer files in your site panel, thereafter, its time to upload them to your new web host and servers.
By using FTP client, connect to your new web host. While connecting your FTP client, you will have to enter your site domain name as a host.
However, your domain name is still indicating to your old host, so by entering the IP address of your server or server hostname, you will have to connect it. You can also get this information from your new hosting account’s cPanel dashboard.
Upload both installer.php and archive.zip file to the root directory of your site. Usually, this is /username/public_html/folder.
You can also ask your web hosting company in case of an issue.
Remember that your root directory should be completely empty because many web hosting companies install WordPress automatically when you sign up.
If you have installed WordPress already in your root directory, then delete it. Thereafter, upload both archive zip file and installer.php file to the root directory of your site.
Change the hosts file for preventing the downtime
After uploading both files to your new host, access the installer.php file in a browser.
The file can be accessed using a URL like given below:
But the main problem is this URL will take you to your old web host, and you will get a 404 error as your domain name is indicating to your old web host.
Generally, some other tutorial might tell you to change your domain nameservers and point to your new host. But this will result in your users seeing a broken site as you move it.
We’ll show you how you can access your new site temporarily on your computer without affecting your old site. This can be done with a hosts file on your computer.
The hosts’ file maps WordPress domain names to particular IP addresses. Now let’s have a look at how we can add an entry for your domain name in the hosts file so that it indicates to your new hosting company.
How to add an entry for your domain name in the hosts’ file?
The below steps will show how to point your new host, but only when using your computer. The changes will authorize you to access the files on your new host using your own domain name, but the rest of the world will, however, accessing your site from the old host.
Firstly find the IP address of your new web hosting server. For finding this log into your cPanel dashboard and click on expand stats link in the left-hand sidebar. This will extend the sidebar displaying you information about the status of your server. The information you should copy is the Shared IP Address.
Here, Windows users need to go to Programs>>All Programs>>Accessories, press right-click on Notepad and choose the Run as Administrator. Here, you will see a Windows UAC, click on “Yes” button to launch Notepad with administrator privileges.
On the Notepad screen, visit File>>Open and then go to C:\Windows\System32\drivers\etc. And choose the hosts’ file and open it.
Mac users need to open the Terminal app and enter this command to edit hosts file: sudo nano /private/etc/hosts
For Windows and as well as Mac users, enter the IP address you copied and then enter your domain name. Like: 192.168.1.22 www.example.com.
Remember that replace your IP address with you copied from cPanel and example.com with your own domain name.
Save all your changes and you can now access your files on the new host using your domain name on your computer.
Create MySQL Database on Your New Host
Here, you have to create your MySQL database. To create it – go to step 4 we have mentioned above, and create it successfully.
Start the Duplicator migration process
For the WordPress Duplicator Migration Process, go to the given-below address in your browser window, and replace example.com with your domain name:
Now the installer will run a few tests and appear you “Pass” and you will appear next to validation and validation tests.
Check the terms & conditions checkbox. Then click the Next button to continue.
Afterward, enter your database details that you have created in the previous step such as MySQL host, database name, username, and password.
Click the “Test Database” button after entering the right information. If this Duplicator plugin connects, then you will be able to see a string starting with Pass. Else, you get database connection error details.
If this plugin connects, then press the Next button to continue.
Here Duplicator will start to import your WordPress database from the archive.zip into your new database.
The next window will ask you to update URL or Path. In case you do not change the domain name so you don’t need to make any change here. Just click the Next button to continue.
Finally, this plugin runs the final step and show you the login button.
Now, you can login to your WordPress site on the new host.
Update Your Domain Name Server (DNS)
Despite created the entire copy of your WordPress files and database on your new server, still, your domain indicating your old web hosting account. Hence, update your domain name with following given below steps:
For updating your domain, switch your DNS nameservers. This assures that your users are taken to the new location of your website when they type your domain into their browsers.
If you want to register your domain name with your hosting provider, then it’s good to transfer the domain to the new host. And in case of using a domain registrar like Godaddy, Namecheap, etc, then update your nameservers.
You should have the nameserver information from your new web host. Generally, this is a couple of URLs that something looks like this:
Look for domain management area and then look for nameservers. If you need any help with updating your nameservers, you can ask your web hosting company. Here we will show you how to change DNS with GoDaddy.
The very first, login to your Godaddy account and click on the Domains.
On the next screen, tap on Manage button that is next to the domain name that you want to change.
You have to click on ‘Manage DNS’ to continue under the ‘Additional DNS’.
Thereafter, click on the change button by scrolling down to the nameserver section.
Here, change the nameserver type dropdown from ‘Default’ to ‘Custom’. Thereafter, fill out your new hosting provider’s information under nameserver.
Click the Save button to store your changes.
Finally, you have changed successfully your domain’s nameserver. Make sure that DNS changes may take 4-48 hours for the whole process.
In case you have the same content on your old host as well as on your new host, so your visitors will not see any difference. And your WordPress migration will be faultless with no downtime. We recommend you to secure – Wait to cancel your old hosting account until 7 days after you migrate WordPress site to new url.
Some other best plugins to migrate WordPress site to new host
There are many plugin options that make migration easy. However, it comes quite difficult to move your existing WordPress site to a new web host or vice versa because it is a time-consuming and complex as well. As a WordPress user, you can migrate your site to a different web server by using WordPress Migration plugins.
Reasons for using WordPress Migration Plugin
Following are the reasons for using a WordPress migration plugin:
- It is a safe and quick process, so all your website files and database remain untouched.
- Your website wouldn’t go offline when using a migration plugin to move your site to a new web host.
- All web hosting provider does not offer free WordPress migration. In this case, you can do this process by yourself.
Best WordPress Migration Plugins
1. WP Migrate DB
WP Migrate DB is focused completely on your WordPress database. If you’ve ever tried to manually move a WordPress site, you know that the database is the most irritating part. Generally moving your other files is a matter of copying and pasting but moving the database that can get tricky.
WP Migrate DB makes it easy by finding and replacing URLs and file paths. This is important if you migrate WordPress site to new url. Like in case you’re migrating a production version of your website to your localhost for testing, you’ll require updating all of the URL paths for matching your localhost. And this plugin does that for you.
If you’re hands-on or a WordPress developer and don’t mind copying your other files manually, WP Migrate DB is the best option.
2. All-in-One WP Migration
It is a free plugin with premium extensions that completely focused on moving your site to a new server or domain name. It covers moving your database and your files, which means it handles all aspects of migration.
All-in-One WP Migration makes use of some marvelous tricks to ensure that it works for all hosting providers. Firstly it exports/imports data in 3 second time chunks, which lets it bypass any restrictions placed by your host. It does something similar to upload sizes, so even if your host restricts uploads to a certain max, All-in-One WP Migration will still be able to move your site.
If you require changing your domain name, All-in-One WP Migration lets you do an unlimited find/replace operations on your database and will resolve any possible serialization issues to make sure that everything works smoothly.
The free version of this plugin supports moving sites up to 512MB in size. If your site is any bigger, you’ll require going with the unlimited version, which removes the size limit.
They also have extensions which can help move your site to cloud storage providers, for example, Dropbox or Google Drive.
It comes straight from Automattic, the company behind WordPress. VaultPress backs up and protects every part of your WordPress site. After you have a backup, it’s quite easy to clone your site to a new location with VaultPress Restore to a different Site tool.
But for this, you need to enter your FTP details and domain name if you’re changing domain names VaultPress will handle the rest.
The drawback of using this plugin is that it’s a subscription service. However, it is part of Jetpack. So that subscription payment will literally get you access to all of the other premium Jetpack features as well.
4. WP Clone by WP Academy
WP Clone is an excellent migration plugin with one major differentiating factor as you don’t have to muck around your FTP program for handling your migration.
All you require to do is create a fresh WordPress install at the location where you wish to clone your WordPress site.
Then after you just require to install the WP Clone plugin on your fresh install and it will handle the migration for you. If you don’t know about installing the plugin then have a look at our article on How to install a plugin in WordPress.
If your website is large, you should go with a different migration plugin. Smaller sites (under 250MB) are more likely to move through WP Clone.
Through this guide, we have tried to break down a few various scenarios and which migration plugin you should select for each. In case you are confident enough to upload two files via FTP, then my entire top suggestion is Duplicator, as it is best to use.
Well, that’s a wrap for this post and we hope that you truly liked this blog. While migrating a website to a new server the entire data is lost and potential goes down due to (downtime). We hope that the above steps helped you to move WordPress site to a new host with no downtime.