WordPress.org

Ready to get started?Download WordPress

Forums

moving wordpress to new domain but leaving the database (7 posts)

  1. simon.ker
    Member
    Posted 2 years ago #

    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 http://installation.old-domain.com and i want to move it to http://www.new-domain.com/installation 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 "http://www.new-domain.com/installation" 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?

  2. Snat
    Member
    Posted 2 years ago #

    When you changed domain, did you move it to a new web host or a new account with the web host ?

  3. simon.ker
    Member
    Posted 2 years ago #

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

  4. Snat
    Member
    Posted 2 years ago #

    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.

  5. simon.ker
    Member
    Posted 2 years ago #

    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');

  6. Snat
    Member
    Posted 2 years ago #

    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.

  7. jwinter66
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic