How to easily Migrate Your WordPress Site To A New Web Host

How to easily Migrate Your WordPress Site To A New Web Host

Are you willing to move your WordPress site to a new host or different server? Moving your website to a new host can be a terrifying and stressful experience, but it doesn’t need to be.

Most of the people are faced with the need to move to a new host because of problems with their current provider. However, migrating to a more reliable host is delayed time and again for fear of making a mistake and damaging your site.

If you spend a few time preparing your own website, migrating is nothing to be concerned about. It can be a very straightforward project if approached properly and can easily be reversed out of should any problems occur.

If you feeling any sort of difficulty then you can contact our WordPress Migration Team as you can dial our number + 1 844 897 0441(Toll-Free). Our WordPress team will help you instantly to resolve all your issues.

Some of the steps required to move your WordPress website to a new host:-

migrate

Step 1: Back Up Your Website’s Files

In the first step back up every aspect of your site. This step is best practice before any major change but it is also a necessity of migrating your WordPress installation.

There are plenty of plugins available that will entirely backup your site for you. This backup, however, needs a more manual approach. 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 2: Exporting the 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 and 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 the Go button and the database export process will begin and a file will be downloaded to your local computer.

Read More: How to Migrate Your WordPress Website from Joomla to WordPress

Step 3: Creating the WordPress Database On Your New Host Server

Before the migration to the new web host, create an environment for a WordPress installation. For doing this you must create a database that you can import your SQL data into.

Just log in to your new web host with the user credentials they have supplied you and connect to the cPanel software. Here we will be using the MySQL Databases application. In case your web host doesn’t have that application running then contact their support team for discovering a method of creating new databases.

Some of the steps for creating a database:

  • First of all open MySQL Database and create a new database with a suitable name for your website.
  • Next, create a new MySQL user with a secure password.
  • You have to add this user account to the new database
  • Just write down the name of the database, the new MySQL username and its password. As you will require them soon.

Step 4: Edit the wp-config.php File

For editing the wp-config.php File browse to the folder on your local computer where you downloaded your website files. You will see that in that folder there is a file called wp-config.php that regulates the access to WordPress and your database.

Make a copy of this file and save it to another folder on your local computer. This is important for restoring the changes we are about to make.

Open the original version of the file with your favourite text editor and make the following changes:

1. Changing the Database Name

Locate the following line:

define(‘DB_NAME’, ‘db_name’);

The db_name portion of this line will presently be set to the MySQL database name of your old web host. And this must be changed to the name of the new database you have just created.

2. Changing the Database Username

You will find the line below:

define(‘DB_USER’, ‘db_user’);

In this line, you are required to change the db_user portion from the username of your old host. So that matching the new username you have just created.

3. Change The Database User Password

Edit the third line:-

define(‘DB_PASSWORD’, ‘db_pass’);

The db_pass section of this line must be changed to the new secure password you created for your MySQL user. Save wp-config.php and close the file.

Step 5: Import Your Database

Now that you have a new database to work with you can begin the import process.

Launch phpMyAdmin from the cPanel software on your new server and choose your new database from the list on the left hands sidebar. After it opens select the Import tab from the navigation menu.

In the File to Import section tap the Choose File button and select the SQL file you exported previously.

Just Un-tick the Partial Import check box, make sure the format is set to SQL and then click the Go button. The database import will now begin. The time this import takes varies relying on the size of your database.  when it has finished you should receive a message informing you of the success of the import.

Step 6: Uploading the WordPress Files To Your New Host

Now it’s time to begin uploading your website’s files. As your new database is ready and you’ve reconfigured the wp-config.php file.

For this connect to your new web host using your FTP program and browse to the folder that your website is going to be held. If 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 the remote directory selected you can upload your website files that should now contain the updated version of wp-config.php. With the earlier download, this process can take some time.

Once the upload finishes don’t delete these files from your local computer. They are still required unless the final steps have been completed.

Step 7: Linking to New URL and Defining New Domain

In case you are moving to a new or different domain then you should read over this step.

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.

If you wish to easily search for any instances of your old domain name and replace with the new name then we recommend you to look at the Search Replace DB script on github.

As this will let you do this with easiness. Just make sure you DELETE it when you are done for security reasons and don’t place 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 for the old domain and replacing with the new domain. You’ll also be altering the site_url and home url values in the database.

Read Also: How to Migrate WordPress Site From Subdomain to Root Domain

Step 8: The Final Touches

This step includes two separate things with potentially various days between them.

Before you can use the site on your new host you will want to reconfigure your domain’s DNS settings. They will be set to point to your old host and you will require pointing the correct records to the new server IP address.

This process will rely on where you have your domain registered. The details of completing this process are too varied to discuss in this post, but your domain registrar should have all of the details you required to make this change.

DNS changes can take up to 48 hours to completely propagate. It’s great to do this at a period when you expect lower levels of traffic. During this 48 hour window, you should avoid making any changes to your site as you may be changing the old version of the site.

After the 48-hour period has expired you should now be accessing the new web host when you go to your website. You can connect to your old web host to delete the files and database. You should still have a local backup copy of these files and the database export along with the original wp-config.php file. It can be a good idea to hold onto these files for a lengthened period just to be on the safe side.

Well, that’s a wrap for this post and we hope that you truly liked this blog.

Infographics

Talk to our WordPress Technical Support Team, just dial our Toll-Free number for any assistance + 1 844 897 0441.

Some of our Other Blogs:



Leave a Reply