Last week while I was doing some spring cleaning, I decided to move a few of my sites over to a new CPanel.   The move went fairly smoothly, but once everything was moved, there was the matter of updating the WordPress database to show the new database name. If you are wanting to do something similar, here is what you need to do.

All you need to do is update the wp-config.php file to point towards the new database name, which should be found in the root of your WordPress installation.   Open the wp-config.php file and look for the following code:

define('DB_NAME', 'dbname');

Where it says dbname, update the name of your database.  If your login name changed, you’ll want to update that as well.

Once that was done, the only problem I encountered was that I was unable to upload pictures.   The fix?  Go into your WordPress dashboard and go to Settings –> Miscellaneous and update the path where images are uploaded to.

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level in 2007 by launching WPHacks.com as a place to share hacks, tutorials, etc. Connect with Kyle on Twitter or Google+!

  • http://www.datalab.pl Odzyskiwanie Danych

    Thanks. I’ve Updated it couple days ago but I had problems with uploading pics ever since. I didn’t expect the solution to be that easy.

  • Dev

    Thanks @kyle..Now i can update my data base without having any problem..

  • George Serradinho

    Hi there,

    I thought you meant something else with your title. I would of done the same but would have not though about the picture problem. Thanks for sharing this info.

    Could I ask why you would move your DB?

  • http://kyleeslick.com Kyle Eslick

    @ George – I think you’re right about the title, so I went ahead and tweaked it a bit to hopefully be more clear.

    As far as moving a few of my databases, I originally had over 120 websites all on one CPanel. I’ve been branching them out into clusters over 3-4 CPanel’s to optimize my setup and hopefully optimize performance as well. This will also make it easier if I decide to sell a few sites at some point.

  • DogDay

    My last comment was removed. Instead of understanding that I agree with George Serradinho: “I thought you meant something else with your title”.

    The difference is that I talk with ironic words. Is it forbidden here?. (Notice about irony again).

    Thanks in advance.

  • http://kyleeslick.com Kyle Eslick

    @ DogDay – We don’t really censor comments here as long as they meet two basic guidelines. Comments need to be relevant to the topic of the post and they need to be constructive, offering some general value.

    We regularly approve negative comments as long as they meet those two guidelines. :)

    Is it possible it was caught by the spam filter? or maybe you can just retype the comment?

  • George Serradinho

    I see you have changed the title :)

    It must be hard to remember all the details of the sites you have, I’m struggling with just 3.

  • http://kyleeslick.com Kyle Eslick

    @ George – Yes, it can be difficult, but only a few are blogs. Most I “set it and forget it” using niche marketing, which is basically just building a site that generates revenue and then let it generate revenue over the months/years. :mrgreen:

  • http://www.mojadieta.eu Dieta

    This seems easy enough. I was affraid of doing that because I wasn’t sure if I can get everything to work again. Thanks for the tutorial.

  • http://www.dotmainname.com Deca
  • Pingback: Daily Links | AndySowards.com :: Professional Web Design, Development, Programming, Hacks, Downloads, Math and being a Web 2.0 Hipster?

  • Amanda

    thanks this is what i needed!

  • http://www.lako.pl Oprawy Oswietleniowe

    Thank you for this tip. Its quick and easy. Now there is no problem with update.