WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How to move a WordPress database from 1 host to another

[Resolved] How to move a WordPress database from 1 host to another

  • My WordPress server is dead, the only thing I have is a database backup zip file. I have installed MAMP on a different server, and imported the database backup on the new server…but my wordpress blog does not work…..where in the database do I change the hostname and url settings? Or can I just import a specific table into the new MAMP install, which will take across all my blog and pages from my old server?

    Any help would be great

    Thanks Richard

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

    @esmi

    Forum Moderator

    Are you referring to the site’s domain name? Or the database hostname?

    U can use:

    update wp_posts set guid = replace(guid, ‘http://oldurl.com’, ‘http://newurl.com’)
    update wp_posts set post_content = replace(post_content, ‘http://oldurl.com’, ‘http://newurl.com’)
    update wp_options set option_value = replace(option_value, ‘http://oldurl.com’, ‘http://newurl.com’)

    The url from the old host was http://xyz123/wordpress, but the new install is http://localhost:8888, I’ve got mysql, php and Apache all installed on the same host.

    So if I can get the web pages working under localhost, I will then change them to the new hostname url http://abc123/wordpress

    esmi

    @esmi

    Forum Moderator

    You need to look in the wp_options table for options names siteurl & home and change the values.

    Works a treat…thank you very much….I’m back up and running again

    cheers

    esmi

    @esmi

    Forum Moderator

    Glad to hear it 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] How to move a WordPress database from 1 host to another’ is closed to new replies.