Migrate Wordpress to a new domain name Print

  • 0

Changing Your WordPress Domain Name While Moving Your Site to a New Location

There are different ways to move your WordPress site between servers. You should only use this method if you want to change the domain name your WordPress site is hosted on while you are moving the site.

You need to export your existing files and database, and then import the files along with the database on to the new site. Finally, to complete the process, you need to update your wp-config.php file and repair any broken links on your site.

1. Exporting and Downloading a WordPress site Away from a Server

To export and download WordPress sites from your current host, you need to back up your existing database and have access to the WordPress files on your existing server.

To Export and Download a Blog Away from a Server

  1. Identify the database (examine the wp-config.php file) that your WordPress blog uses, and then create a backup of your database as an SQL file. This can be done using the database Admin Panel's export facility. More from Wordpress.
  2. Connect to your existing hosting account using File Transfer Protocol (FTP).
  3. Download the entire contents of the sites folder to your computer.

2. Importing and Uploading a WordPress Site to a New Site

To import and upload your WordPress site to our servers, you need to access the new hosting server and database.

To Import and Upload a WordPress Blog to a New Location

  1. Connect to your new hosting account using FTP.
  2. Upload the sites folder you saved.
  3. Create a new MySQL database and database user. This can be done from the sites control panel.
  4. Note the database's Database Name, Database Host IP Address, Database Username and the password you used.
  5. Restore the SQL file you saved into your new database. This can be done using the control panel for the new database and the Import facility.


3. Updating Your wp-config.php File

To make your site work again, you need to update the wp-config.php file with your new domain name.

To Update Your wp-config.php File

  1. Using your hosting control panels File editor, open your wp-config.php file.
  2. Add the following two lines to the file, where example.com is the correct location of your site.
  3. Locate the section that looks like this example:
    /** The name of the database for WordPress */
    define('DB_NAME', 'putyourdbnamehere');
    /** MySQL database username */
    define('DB_USER', 'usernamehere');
    /** MySQL database password */
    define('DB_PASSWORD', 'yourpasswordhere');
    /** MySQL hostname */
    define('DB_HOST', 'DBHostIP');
  4. Enter the database information from your database as follows:
    • putyourdbnamehere is your MySQL Database Name
    • usernamehere is your MySQL Database Name
    • yourpasswordhere is your MySQL Password
    • DBHostIP is your MySQL Host IP Address
  5. Save your modifications.

4. Fixing Broken Links After Moving Your WordPress Site

Finally, you need to clean your site of outdated link paths.

To Fix Broken Links After Moving Your WordPress Site

  1. Log in to your WordPress admin panel.
  2. From the Plugins menu, click Add New.
  3. Enter Search and replace, and then click Search Plugins.
  4. Locate the Search and Replace plugin, and then click Install Now.
  5. Click OK.
  6. Click Activate Plugin.
  7. From the Tools menu, click Search and Replace.
  8. Enter your old site URL in the Search for field. For example, http://olddomainexample.com (no trailing slash).
  9. Enter your new site URL in the Replaced with field. For example, http://newdomainexample.com (no trailing slash).
  10. Select All, and then click Go.
  11. Using your hosting control panels File editor, open your wp-config.phpfile, and remove the following two lines:

More information is provided by Wordpress here.

Was this answer helpful?

« Back