Monday, May 20, 2024

How to move your WordPress blog to a new host server with zero downtime

Share

If you are a WordPress blogger and wants to move to a new host server from your old hosting server, this article will help you to move your blog without any downtime and also you wont loose your SEO (Search Engine Optimization)
Usually you move to a new hosting servers at the time you upgrade to a new plan, or to reduce the renewal cost for that you buy a new plan from the same seller or from a different seller at a discount price.

NOTE: It is always recommended to take a Full Backup of your files before making any major changes to revert back in case of any disastor.

Moving a Website or a Blog can be daunting, but it is easy to do if you are following the steps one by one carefully without any miss. We suggest using a faster internet while you upload or downloading the files to make your website have the latest data and statistics like page views and comments.
If you are moving to a new hosting plan on the same Web Hosting Company, you can follow the below steps and migrate your blog with zero downtime. For different hosts you may need to wait upto 48 hours for the DNS to be propagated properly in the network.

Backup Your WordPress Database Using phpMyAdmin

Before transferring your WordPress blog, it is recommended that you make a backup of your database using phpMyAdmin. Once you have successfully logged into phpMyAdmin:

  • Click on the name of the database which contains your WordPress blog.
  • Click Export in the top navigation menu.
  • Select the Quick option listed under the Export Method section.
  • Leave the selection in the format section as SQL .
  • Click Go.
  • Once completed, there will be a prompt to save the file. Simply click on Save as File; this will download a file named <filename>.sql to your desktop.

You have now successfully backed up your database.

Download/Upload All WordPress Files

You will need to download ALL your files from your old host and upload them to your new host. This includes files from your themes folder and plugins folder. Make sure you also download any folders which were referenced outside of your blog’s folder.

You can just zip all the files under Public HTML, download and upload it to the new host in the same path and unzip it.

Create a New WordPress Database and Edit wp-config.php

Create a New Database

To create a new MySQL database:

  • From your control panel, click the MySQL Databases icon.
  • Create a new database with a name appropriate for your blog.
  • Create a database username and password.
  • Assign the new user to the new database and grant All Privileges.

Editing the wp-config.php File

After creating a new database, you will need to edit the wp-config.php file, which is the WordPress configuration file. This specific configuration file reads directly from a database of your choosing.

To update the WordPress configuration file:

  • From your control panel, click the File Manager icon.
  • Navigate to the document root for the domain for which you are updating the WordPress.
  • Locate the file named wp-config (its normally in the group of files near the bottom).
  • Click to open the file, and locate the following lines so that they can be updated with the correct information:

/** The name of the database for WordPress */
define(‘DB_NAME’, ‘dbname’);

/** MySQL database username */
define(‘DB_USER’, ‘username’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘******’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

If you did not edit the file on the server via the File Manager with your new database settings, upload it to the root of your blog folder.
The configuration file is now set up with the new database; however, it does not contain any database tables. In order to correct this, you will need to import the information into the database.

Importing WordPress to the New Database

  • Login to phpMyAdmin
  • Click the name of the Database to which you wish to import the information.
  • Click the Import tab at the top of the page.
  • In the File to Import section, select the SQL based file from your computer that you wish to import.
  • Click Go to initiate the import.

Changing the Shared IP name

Now the final step is to change the DNS to the new Shared IP of the new server. Copy the IP address from the new cPanel and replace the old address.

If you are using a CDN, you have to change the IP at the DNS of your CDN account.

Leave a Reply

Read more

More for you