WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to move a WordPress database from 1 host to another (7 posts)

  1. rleslie
    Member
    Posted 1 year ago #

    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

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  3. adpawl
    Member
    Posted 1 year ago #

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

  4. rleslie
    Member
    Posted 1 year ago #

    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

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  6. rleslie
    Member
    Posted 1 year ago #

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

    cheers

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Glad to hear it :-)

Topic Closed

This topic has been closed to new replies.

About this Topic