1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Migrating WordPress Blog from One Host to Another Host

Migrating WordPress Blog from One Host to Another Host

The information provided below is for reference only. Please note that HostGator Live Support agents cannot troubleshoot migration issues, including those involving custom coding and scripting errors.

Before we proceed, it is important to note that website migration and domain transfer are two different processes. This article focuses on migrating your WordPress website from another hosting company to HostGator, which means you want HostGator to host your website. However, if you also want to move your domain name over to HostGator, which means you want us to be your domain's registrar, we can definitely help you with that! You can visit our front-of-site, https://www.hostgator.com/domain-transfer, so we can begin the process. Think how awesome it would be to manage both your domain and website in just one place!

Here are support articles to shed some light on the difference between these two processes.

Migration Form

We made it easier for you to migrate your WordPress site! HostGator has a dedicated team of Migration Administrators trained to migrate any content to your HostGator server. To request a migration (including a quote for the service if any is required), please submit our migration form. New or upgrading HostGator customers may review the article below to see if they can request a free content migration.

Manual Migration

On the other hand, if you are comfortable navigating your File Manager, database, and FTP and would like to migrate your website yourself to your new host, please proceed with the manual migration process below, which comprises several steps.

We strongly recommend using the migration form in your Customer Portal as our HostGator's Support agents cannot monitor the whole manual migration process and are not responsible for the turnout.

Step 1: Backup your WordPress database using phpMyAdmin

Before migrating your WordPress blog, you need to create a backup of your database using phpMyAdmin.

To create a database backup via phpMyAdmin:

The location of the buttons, links, and tabs shown in the images below may look slightly different within your host's control panel; however, their functionalities in phpMyAdmin should be the same.
  1. Log in to your host's phpMyAdmin.
  2. Select your WordPress blog's database name.
  3. Click Export in the top navigation menu.

    phpMyAdmin - Export tab

  4. Select the Quick option listed under the Export Method section.

    phpMyAdmin - Export - Export tables

  5. Keep the format section as SQL.
  6. Click Go.
  7. The database will start downloading. Once done, you will find a .sql file on our computer.

You have now successfully downloaded a backup of your database!


Step 2: Download and upload all WordPress files using FTP

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. For example, if you are using a separate folder called 'images,' located outside of the blog's folder, the images must be copied and uploaded to the new hosting location; otherwise, the site will contain many broken links to images within the blog post.

Filezilla is the recommended FTP client. By default, Filezilla does not display the .htaccess file for security reasons. To ensure that your .htaccess file is included in the download, you must click on Filezilla's Server tab, then select Force showing hidden files.

FileZilla - Force showing hidden files

If you neglect to upload your .htaccess file, your permalinks will not work.

Please check out these FTP support articles for more information on how to use FileZilla, especially in uploading (or moving) your files to your HostGator hosting server.

Note: You should NOT update to a newer version of WordPress at this time as your database may not sync correctly. Complete the WordPress migration before you consider upgrading the WordPress version.

Step 3: Create a new WordPress database and database user

Once your WordPress core files are uploaded to your HostGator's server, you need to upload the database (.sql) file you downloaded from your old host in Step 1 to your HostGator database. To do this, you will have to create a new database and database user within phpMyAdmin and assign privileges to your new database user.

Please visit the following articles for the complete instructions on creating a new database and user within your destination control panel.

Once done creating your new database name and database user, grant All Privileges to your new database user. For more details, please visit the following support article.

Okay! Now you are ready to configure your wp-config.php file.


Step 4: Edit 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 your database.

To update the WordPress configuration file:

  1. From your control panel, click the File Manager icon.

    cPanel - File Manager

  2. Navigate to your WordPress domain's document root.
  3. Locate the file named wp-config.php.
  4. Right-click to edit 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', 'yourdatabasename');   
    /** MySQL database username */   
    define('DB_USER', 'yourdatabaseusername'); 
    /** MySQL database password */   
    define('DB_PASSWORD', '**yourdatabasepassword**');  
    /** 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.
  5. Ensure that the information you will input here matches the database name, user, and password you created in Step 3.

The configuration file is now set up with the new database; however, it does not contain any database tables. To correct this, you will need to import the information into the database as described in Step 5 below.


Step 5: Importing WordPress to the new database

You can use either phpMyAdmin or BigDump to import your database. BigDump is the preferred option if you have a large database (10MB or more). There is a step-by-step guide on how to use BigDump on its website.

To import your WordPress database via phpMyAdmin, here's a quick overview.

  1. Inside the phpMyAdmin, select the new database name from the left-hand menu.

    phpMyAdmin - Select Database

  2. Click the Import tab in the top menu.

    cPanel - phpMyadmin's Import Tab

  3. Upload the .sql file on your computer using the Choose File button, then click Go.

For the complete instructions, you can visit the article, How to Import Your MySQL Database.

Once all of these steps are done, try accessing your site in a browser.

If you would like us to determine your eligibility for a free migration or request a quote for the migration, please fill out the migration request form or just contact us via phone or Live Chat with a description of what you need.