Support » Fixing WordPress » moving wordpress to new domain but leaving the database

  • Ok. this must have been answered but I can’t find it or I am doing something wrong, so sorry about that..

    I have a wordpress installation at and i want to move it to but leave it pointing at the same database..

    I was hoping this was just a case of logging in as admin and changing the WordPress address (URI): and Site address (URL):to “” then downloading the whole installation via ftp and uploading it to the new domain. But this isn’t working…

    I’m getting an “Error establishing connection to database” error when i try to login.

    Should this work or do i need to do something to the database to allow connections from the new domain?

Viewing 6 replies - 1 through 6 (of 6 total)
  • When you changed domain, did you move it to a new web host or a new account with the web host ?

    hi Snat it’s with a different host. The database is with another host altogether though if that helps

    It does indeed.

    Right basically what happened is WordPress can not find the database. So you will either need to move the database to the new host, or change wp-config.php to reflect the old webhost.

    You can ask them (old host) if they allow external MySQL connections and if so, what is the hostname you will need. Once you get that, come back and I will explain which edits you need to do.

    If you can not do that, you will need to move the database which is a simple enough task these days.

    ahh – i see what you are saying but the database is already defined in wp-config as it is external to the existing blog

    i guess you were going to suggest changing this?…
    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    it is already
    /** MySQL hostname */
    define(‘DB_HOST’, ‘my.mysql.db’);

    I am guessing “my.mysql.db” is being used by your old host internally as a hostname to point to their database server. You will need to ask your old host (where the database is) if they allow external connections or move your database over to your new host.

    look at a plugin called wordpress move. it will make this easy to do.

    you can us it to move to a new domain (different name) or works well when moving a domain to a new server.

    when installing new plugins if you type wp move in the search box it will come up.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘moving wordpress to new domain but leaving the database’ is closed to new replies.