How to replace MySQL database with a new one

Avatar
  • Answered
I wanted to create a new database with a name that was easier for me.
I created the new database. Then I exported from the old one and imported the data to the new database.
Both databases show in Cpanel. However they are slightly different sizes. When comparing them I can see that WPoptions is slightly smaller in the new database. I'm assuming this is due to my plugins not working correctly.
Is that a correct assumption?
Now I want to make the new database the only one. How do I tell the website to use the new database?
Also, how do I delete the old database?
Avatar
Scott
Hello,

Thank you for your question on switching and deleting databases for your site. In looking at your site, it appears to be a WordPress site. You can easily change the database used for that site by editing the wp_config.php file in the root directory of your site. There are three settings inside the file to change. One for Database name, one for database user, and one for the user's password. After changing those to the new database, then the site will use it.

I am unsure as to why the wp-options table is a different size.

When you are ready to delete the database, just visit the MySQL Databases tool in the cPanel. Next to the database you want to remove, there is a delete link. Click that to remove the database from your cPanel.

Kindest Regards,
Scott M