WordPress.org

Forums

[resolved] Replicate a WP install from test site to deployment site (6 posts)

  1. krimsly
    Member
    Posted 6 years ago #

    Greetings all.

    I am building a WP site in a test/staging area. Once I'm done, I want to deploy the live site at a different hosting company with a different mySql database instance. It's important that the settings get preserved. I'm not sure the best way to do this-- my idea was:

    * Build a fresh, blank mySql database at the live hosting company.
    * Export the test/staging database and import it into the live blank database.
    * Copy all the WP files from the test/staging area to their final resting place on the live site.
    * Update user name and password in WP config file. Done!

    Will this work, and is there a better way to do this? :)

    Thanks,

    NorthK

  2. Samuel B
    moderator
    Posted 6 years ago #

    sounds like a good plan - that is what I would do (except if url of blog is changing I would change that in the Settings - General 1st and save then do db dump - that way your site will connect correctly)
    might review this just to be sure
    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_to_a_New_Server

  3. krimsly
    Member
    Posted 6 years ago #

    Samboll,

    Thanks a lot for your reply and the link-- very useful!

    -NorthK

  4. krimsly
    Member
    Posted 6 years ago #

    All,

    I followed the directions in the Moving WordPress to a New Server link and Samboll's additions above. Well, it 'almost' worked :)

    Everything worked except links to images within posts and pages. It turns out that links to media use absolute paths rather than site-relative paths. So none of the image links worked once I moved the site. I had to go into every post and page and change the link URL's to point to the new location.

    Does anyone know if there's a way to tell WP to use site relative links for images and media in posts, rather than absolute links?

    Thanks

    NorthK

  5. krimsly
    Member
    Posted 6 years ago #

    For those of you who run into this problem like I did, here's a great discussion on it: http://wordpress.org/support/topic/159738?replies=19.

    The bottom line is WordPress doesn't handle the ability to modify URL's that point to media from within posts and pages when the blog is moved. But there are workarounds.

    I think what I'll do next time is the search-and-replace method referred to in the discussion above, in the .sql file from the database backup. The .sql file is plain text so you can search for all the media URL's and replace them with the new ones. Then you restore into the production database using that modified .sql file.

    Still, it would be really, really nice if WP managed this situation for us out of the box :)

    Regards,

    NorthK

  6. shalzers
    Member
    Posted 5 years ago #

    This is a very interesting resource on WP migration

    http://wpgarage.com/tips/6-things-moving-wordpress-blogs-different-host/

Topic Closed

This topic has been closed to new replies.

About this Topic