WordPress.org

Ready to get started?Download WordPress

Forums

WP-Admin trying to connect to old database (7 posts)

  1. redicegoddess
    Member
    Posted 2 years ago #

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

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. redicegoddess
    Member
    Posted 2 years ago #

    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.

  4. fonglh
    Member
    Posted 2 years ago #

    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.

  5. redicegoddess
    Member
    Posted 2 years ago #

    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.

  6. starapple
    Member
    Posted 2 years ago #

    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.

  7. fonglh
    Member
    Posted 2 years ago #

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

    http://codex.wordpress.org/Changing_The_Site_URL

Topic Closed

This topic has been closed to new replies.

About this Topic