Configuring WordPress After a MigrationWritten by Brad Markle
So far in this tutorial, you have migrated your WordPress database and copied the files associated with your website. the next step you will need to update your configuration settings so the files you just migrated can communicate correctly with the database. Until you perform this, your site will not display any content and you will receive a database connection error.
A few steps ago in this tutorial we asked you to write down the database name, username, and password. Now, we will need this information to continue the migration process.
Opening the wp-config.php file
1. Log into your cPanel account with InMotion Hosting.
2. Click on the "file manager" icon loated in the "files" section of cPanel.
3. Choose "web root" and make sure to check "show hidden files." Then click "go".
4. In the right window pane of file manager, navigate to the folder that you uploaded WordPress to.
5. Find the file "wp-config.php", right-click on it, and choose "edit".
Editing the wp-config.php File
For the purposes of this tutorial we will say the we created the database with the following database credentials:
- Database name: inmoti5_wpress
- Database username: inmoti5_wpuser
- Database password: secretpassword123
Our current cpanel username is inmoti5 and as you will notice it automatically adds the prefix to database names and usernames.
The database credentials that WordPress uses to connect to your database are contained within the wp-config file. What we'll need to do is find the files and simply change them. Start off by finding this section within the wp-config.php file:
// ** MySQL settings - You can get this info from your web host ** //
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Take a look carefully at the above code, and you should see that this file is define what the database name, username, and password are. The value 'localhost' is very commonly defined as the host, and the average user does not need to change this. After you find this section, update the values accordingly. In our example, the new changes will look like this:
After you've made the above changes, click the "Save Changes" button in the upper right.
There's one last step to migrating your WordPress site. In the next tutorial we will discuss how to test your site's functionality.
Please check the next article on Testing your WordPress website after Migration. If you missed our previous article, please see the Migrating WordPress Files tutorial. For more information on this course please visit Migrating your Existing WordPress site to InMotion Hosting.
Migrating your Existing WordPress site to InMotion Hosting
|1.||Migrating your WordPress Site Data|
|2.||Migrating your WordPress Database|
|3.||Migrating WordPress Files|
|4.||Configuring WordPress After a Migration|
|5.||Testing your WordPress website after Migration|