How to migrate wordpress

Export the WordPress database.

Export your WordPress installation’s database.

  1. Create an SSH account if needed
  2. Connect to the server via SSH
  3. Export the wordpress database to an SQL file using mysqldump
  4. Download the SQL file to the local computer using the server’s file manager, sftp etc.


Upload the files to the new server.

Connect to your web hosting account via your preferred FTP client and upload your WordPress files to your web host account’s public_html directory.


Create a MySQL® database.

Create a MySQL database to which to import the WordPress database in cPanel’s MySQL Databases interface (cPanel >> Home >> Databases >> MySQL® Databases).


Import the WordPress database to cPanel & WHM.

Import your WordPress database backup file to cPanel & WHM. To do this, perform the following steps:

  1. Navigate to cPanel’s phpMyAdmin interface (cPanel >> Home >> Databases >> phpMyAdmin).
  2. Click Databases in the toolbar and then click the database that you created in the previous step.
  3. Click Import in the toolbar. A new interface will appear.
  4. Click Choose File and select the database backup file that you created in Step 1.
  5. Click Go. The system will import your WordPress database.

Change the website URL.

You must change the website URL in your database so that the database connects with your WordPress site. To do this, perform the following steps in cPanel’s phpMyAdmin interface ( cPanel >> Home >> Databases >> phpMyAdmin ):

  1. Locate the wp_options table and click Browse.
  2. Under the option_name column, locate the siteurl entry and click Edit.
  3. In the option_value column, enter your website’s new URL in the text box and click Go.
  4. Locate the home entry and click Edit.
  5. In the option_value column, enter your website’s new URL in the text box and click Go.

Configure the WordPress database settings.

You must configure your WordPress database settings to use the information for the database that you created in step 3. To do this, perform the following steps:

  1. Navigate to cPanel’s FileManager interface (cPanel >> Home >> Files >> File Manager).
  2. Open the public_html directory and locate the wp-config.php file.
  3. Right-click the wp-config.php file and click Edit. A pop-up window will appear.
  4. Click Edit in the pop-up window. The editor will appear in a new browser tab.
  5. Edit the DB_NAME, DB_USER, and DB_PASSWORD lines to match the information for the database that you created in step 3. This will resemble the following example:

    // ** MySQL settings ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'mrfrogor_wp' );
    
    /** MySQL database username */
    define( 'DB_USER', 'mrfrogor_wp' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'zQWDu1CdqbVx' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );
  6. After make your changes, click Save Changes.

Update links and images.

Your website may contain broken links and broken images after you migrate your website. To update the links and images to use your new website’s URL, perform the following steps:

  1. Navigate to cPanel’s phpMyAdmin interface (cPanel >> Home >> Databases >> phpMyAdmin).
  2. Click Databases in the toolbar and then click the database that you created in step 3.
  3. Click SQL in the toolbar.
  4. In the text box, enter an SQL query to update your URLs. For example:

    UPDATE wp_posts SET post_content = REPLACE(post_content, 'localexample.com/, www.mrfrog.com/')
  5. Click Go to run the query.

Save the changes in WordPress interface.

After you updates your links and images, save the changes in the WordPress dashboard to update the URL. To do this, perform the following steps:

  1. Log in to the WordPress dashboard.
  2. Navigate to the General interface (Main >> Settings >> General.)
  3. Click Save at the bottom of the interface.
  4. Navigate to the Permalink interface (Main >> Settings >> Permalink).
  5. Click Save at the bottom of the interface.

Import the site to C-Panel if needed.

Use the tutorial  in order to import the site to C-Panel if needed.

References:

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s