Support » Installing WordPress » WP-Admin trying to connect to old database

  • I just moved my WP site from an old host to a new one and I’m issues with my database.

    After uploading my .sql file to my new database server, I go to log into the my dashboard and I get a message saying:

    Error establishing a database connection

    In the address bar, it keeps pointing to my old database (which is gone now).

    I’ve read the documentation on how to move to a new server, but the reason I initially moved was because I could no longer access my WP Dashboard on my old server. I figured moving would simple (I’ve had to do it before.)

    Unfortunately, if I try to use the .sql file from my old database, I can’t access the dashboard and keep getting the error message.

    Deleting the tables and reinstalling the database on the new host allows me to access the dashboard, unfortunately, all my posts and comments are gone. (Because I can’t import the old .sql file without causing problems.)

    Is there any way to fix this, or am I doomed to just have to start reblogging from the beginning. (Not something I’m willing to do.)

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi


    Forum Moderator

    As I said in my post, I read this documentation already. However, I was unable to log into my dashboard on my old server, so following this step

    Go back to your OLD blog and go to Administration > Settings > General and change the url (both of them) to that of your new site.

    Was an impossibility.

    Now I can’t log into the dashboard on either server to fix the issue.

    That step is if you’re changing your domain name. Did you also change your domain name?

    For the database connection error, you need to check the database settings in wp-config.php and make sure they’re the right ones for your new host. If you don’t know what they should be, ask your hosts.

    Yes, I did change my domain name. And yes, I changed the info in the WP-config file.

    I even went so far as to do a completely fresh upload of WP just to see if that would solve the problem.

    It didn’t.

    Look in the sql file and see if it has the urls for the old site. Try and search and replace if it has. One more possible thing to look at.

    If you need to change the URL and can’t login to the Dashboard, use any of the steps on the following Codex page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP-Admin trying to connect to old database’ is closed to new replies.