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.

 open_filemanager

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".

edit_wp-config

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 ** //
/** The name of the database for WordPress */
define('DB_NAME', 'userna5_wp1');

/** MySQL database username */
define('DB_USER', 'userna5_wp1');

/** MySQL database password */
define('DB_PASSWORD', 'passwordgoeshere');

/** MySQL hostname */
define('DB_HOST', 'localhost');

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:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'inmoti5_wpress');

/** MySQL database username */
define('DB_USER', 'inmoti5_wpuser');

/** MySQL database password */
define('DB_PASSWORD', 'secretpassword123');

/** MySQL hostname */
define('DB_HOST', 'localhost');

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.

Like this Article?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Brad Markle, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Latest Questions

If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Ask a Question!
Recent Questions
  1. I can't access my website
  2. we-creation.com server down
  3. How do I delete the DNS entry?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!