At this point in the WordPress migration class, we've migrated our WordPress Database and our WordPress Application Files. The next step we need to do is update our WordPress configuration file so that the application files can communicate with the database to make your site come alive. Again, this is not as hard as it sounds.

Earlier, we asked that you use the MySQL Database Wizard to create a database, create a database user, and assign that user to the database with all privileges. We also asked that you write this information down as it would be needed later.

How to open the WordPress configuration file - wp-config.php

The following steps will take you through updating your WordPress Configuration file:

  1. Log into your Web Hosting Hub cPanel
  2. Click the "File Manager" icon.
    open_filemanager
  3. Choose "Web Root", "Show Hidden Files", and then click Go.
  4. In the right window, navigate to the folder that contains your WordPress files.
  5. Find the file named wp-config.php, right click it, and choose "Edit". If you're asked about the character encoding to use, choose "ISO-8859-1" and then click "Edit".
    edit_wp-configa

How to Edit wp-config.php

In our previous example, we created the following MySQL credentials:

  • database name: whhsup5_wpress
  • database username: whhsup5_wpuser
  • database password: passwordgoeshere

Our cPanel username is whhsup5, and as you can see from the above cPanel automatically adds this prefix to all 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', 'whhsup5_wpress');

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

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

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

After you've made the above changes, click the "Save Changes" button in the upper right.

With one more step to go, we're almost done with the WordPress Site Migration! Continue to the next article to learn how to test your work.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

2012-04-01 5:28 pm
I love the straightforward step-by-step instructions with reminders of what we're working on and where we are in the process.

Might be nice to include a troubleshooting link afterward; my migration isn't working, and I may have done something wrong before or while consulting these instructions.

Thank you for making it clear and simple.

LFiggs
Staff
13,688 Points
2012-04-02 12:57 pm
Hello LLFiggs,

Thank you for the compliments on our tutorial. There are many possibilities when it comes to WordPress errors and troubleshooting. I'm sorry you're having trouble with your migration. I tested your site and I'm not seeing any errors. If you are still experiencing an issue with your site, please feel free to submit a question in the Support Center and give us any error messages you are seeing, where you are seeing them, and steps to recreate the errors. We'll be happy to help you resolve those.

Regards,

Christi N.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

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

Not a Customer?

Get web hosting from a company that is here to help.