WordPress.org

Ready to get started?Download WordPress

Forums

Moving a single site to it's own WordPress installation (17 posts)

  1. FittingSites
    Member
    Posted 3 years ago #

    I am attempting to create a development environment using multisite, and I see no clear instructions on how to move a sub-site to it's own WP installation. To be clear, I need to export the mySQL database and related folders/files to create a stand-alone site.

    I am aware of the ability to use the Export/Import functions (as if moving from .com to self-hosted, for example) but that will not work for my situation. Sites that I develop for clients are quite heavily customized, and I need to be sure that those customizations can be moved to an independent WP install with a minimum of rebuilding.

    I'd love to leverage the strengths of multisite as it relates to development environments, but not if it means I will have trouble deploying client sites once development is complete. I'm sure I am not alone in this need.

    Does anyone have a good work flow for this type of move that they can share?

    Thanks!

  2. I don't have a good flow for it. My GUESS would be (assuming you wanna move blog #7) to export all the wp_7_* tables from your DB, edit it to wp_*, change URLs in that SQL file

    Then copy the /wp-content/blogs.dir/7/files folder down, and make that your new site's /wp-content/uploads (that is files becomes uploads) and edit your whole DB so domain.com/files/ becomes domain.com/wp-content/uploads, as WELL as /wp-content/blogs.dir/7/files becomes /wp-content/uploads/

    It's the users that'll getcha if you have a lot of posts :/

  3. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    I really don't see what the benefits are to developing would-be single sites in a multisite environment compared to multiple single installs. Apart from the fact that, ideally, the development environment should match the production environment as closely as possible, why go to all that trouble?

  4. FittingSites
    Member
    Posted 3 years ago #

    @Ipstenu - Yeesh, that sounds like a fair amount of hoops to jump through! Thanks for what looks like a complete rundown of the process. Thankfully my dev sites only have a few users at most.

    I suppose you could hybridize the move if you have a ton of users. I.E., strip users and posts out of the DB and then use the usual export/import process to bring that data over separately after you have the single site up and running.

    @esmi - I agree with your thoughts. Primarily, I'm interested in using multisite to ease the process of keeping WP and associated plugins up-to-date. Some projects stretch over several months, and it is a pain in the ass to keep all my current (independent) dev. sites updated.

  5. If all you're doing is theme development, it can be really handy to use multisite.

    If you're trying to build the entire site, go with what ipstenu said. the users part is... ugh. No fun.

  6. It sounds like, in your case, I would make a SINGLE site to build out them, and then move THAT to my personal MultiSite dev to keep tabs on things and test plugins/themes changes.

    But really for BUILDING a whole site intended for 100% turnover, I wouldn't use MultiSite.

  7. FittingSites
    Member
    Posted 3 years ago #

    I agree that Multisite may not be the best fit for 100% turnover of client sites. Hopefully future versions of WP will make the move to single site easier.

    For internal development (themes, plugins, Etc.) it looks like a good fit, however. I've created a multisite just for this purpose, and like what I see so far.

    Thanks to you all for your feedback.

  8. iftomkins
    Member
    Posted 3 years ago #

    I'm trying to do this right now, and I can say if you can avoid trying to migrate a subsite into a single installation, definitely avoid it. I was testing it on a local server using MAMP and I thought I had it, and then I ran into this redirect loop problem.

    One thing I'm debating is whether to export the wp_users and wp_usermeta from the multisite installation. I'm going with no for now.

    Any tips will be appreciated. I'll let you know how it turns out, and if I develop a "flow" I'll share it.

  9. Make the user on the single site.

    Get the dp dump of posts from the subsite, rename the table, then replace them in the single db.

  10. iftomkins
    Member
    Posted 3 years ago #

    Good idea about the user.

    Since the WP export only does posts, I'm attempting to do a full export of the SQL database because I also want to move all of the plugins with their settings intact and the theme settings intact. Inside the SQL dump, there are a lot of references to wp_8_* as the table prefix, so I'm doing a search replace so that all the tables are just wp_*.

    So I guess what I'm trying to do is just pick up the site and move it wholesale, and then fiddle with the users. Do you think I'm going to run into a brick wall?

  11. If you're bringing over ALL the users, bring users and usermeta. I did that and it worked fine. If you only need SOME users, then I'd probably bring those tables over, but ONLY export the IDs I need.

    It's gonna be hard and annoying no matter what :(

  12. I think you'd be fine really.

    Eithe rset up the users first or like Ipstenu said - bring them too and nuke the ones you don't need later.

    Renaming those tables should work dandy.

  13. iftomkins
    Member
    Posted 3 years ago #

    You guys are the best! It's easy to feel a bit nervous since I couldn't find an actual account of someone doing this before (though I'm sure it's been done), so your advice is heartening.

    So you don't think I need to do a full search and replace to remove wp_8 prefix and replace with just wp_? Renaming the tables should be enough, even on the plugins?

  14. I did a search/replace when I did it, but IIRC all it did was the prefixes.

    (I exported the SQL, edited in text editor, imported into a new DB)

  15. The table prefixes are saved in the table fields themselves, so....

    I just take the dump and edit manually. there's, what? 8 tables? Less time to change 'em than it takes to write a script or run a query.

  16. iftomkins
    Member
    Posted 2 years ago #

    Thanks Ipstenu and Andrea! It all went well! I'm very happy. The only information that didn't migrate is the settings in the Easy 301 Redirect plugin.

  17. magicroundabout
    Member
    Posted 2 years ago #

    I know this query is months old now but I've done this kind of migration several times now and just wrote up the process. I hope I'm allowed to post a link to my article here - I don't see anything in the forum rules that prevents it, and it could be useful for people who stumble over this thread in future:

    http://oikos.org.uk/2011/12/tech-notes-migrating-wordpress-multisite-sites-to-standalone-sites/

    Hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic