migrating from single WP to WP Multisite

Hi All,

I'm in process of migrating several business blogs into a single Multisite install, but after much research, I'm finding that there's no elegant way of getting all of my users and usermeta from one site to the other. The blogs are all heavily-populated with hundreds of posts, hundreds of users, and thousands of comments.

I know I can dump the single site tables to an SQL file, and then a lot of people seem to recommend a simple find/replace to fix the table prefixes (e.g. 'wp_users' to 'wp_4_users'), but this seems inherently dangerous, as what if I there is content in one of the tables that contains the string 'wp_'? I'm sure it's unlikely, but it just seems messy.

And then there's the whole issue of importing users, especially considering that the user id numbers on the various sites will almost certainly conflict, meaning that not only will the users need to be assigned new id numbers, but the usermeta tables will need to be updated to reflect those changes.

Given the popularity of Wordpress Multisite, I simply can not believe that there is no good solution for these piddly little issues! Is there a better way?

Many thanks,
Adam

  • DavidM

    Hi Adam and first off, welcome to WPMU DEV!

    The user data doesn't really seem to me to be the tough part of such a port. You could potentially export your user lists to CSV with the Export Users to CSV plugin, then import them using either the CSV User Import plugin or Batch Create into one site which would then have them all.

    You also might be able to user the User Synchronization plugin and sync all the users to a single site, then export the users from there, or just convert that single site into a Multisite.

    It's really the content and linking the content to respective authors that seems like it could be a bit of a task to me.

    -David

  • adamohern

    Thanks guys! I'll look into the CSV route. Users are uncommonly important for my particular site, because I run a pay-for-membership site, and I REALLY don't want to piss my customers off by making them re-register!! I also have a lot of user-contributed content, and it would be a travesty to lose it.

    Is this the kind of thing WPMu can do on a consulting basis? It's really important that I not screw this up, and I would feel a lot more comfortable if a professional took care of it :slight_frown:

    Adam

  • Timothy Bowers

    Hi Adam.

    Just checking in to see how things are going. :slight_smile:

    Merging sites is not an easy thing to do, it takes a lot of consideration for users, their IDs and any relating article or other DB articles relating to their ID. Then you have an issue of when they have accounts in multiple sites with different IDs.

    Its not impossible but its not straight forward. If it were I doing this then I would write some MySQL statements, perhaps even a php script (once assessed) which would import the data and merge duplicate users by ID, whilst updating their articles.

    It gets more complicated when you use multiple plugins, with multiple post types.

    Its not something which WPMU Dev would currently do. But you could post your job to our job board:

    https://premium.wpmudev.org/wpmu-jobs

    It probably won't be to cheap with a decent developer.

    Anyway, we haven't heard form you on this in a while. So I'm going to presume your all fixed up now and don't need any further assistance.

    However if you have more questions or need some more help then please feel free to respond in this thread or create a new one and we will be more than happy to offer assistance. :slight_smile:

    Take care.

  • adamohern

    Thanks Timothy!

    I was wondering if it would be possible to do a quick SQL query that would go through all of the tables that use the user ID number, and simply add some multiple of 10000 to them. So site #1's ID numbers stay unchanged, but user 1 on site #2 becomes user 10001, and user 1 on site #3 becomes 20001. Then you should be able to merge the databases without conflicting ID's.

    Maybe it's an overly simplistic solution, but a thought I had recently.

    As of now we're thinking about using a plugin to link the user databases between the sites, and then creating symbolic links on the server between the plugins and themes folders for each site. That way we can at least keep all of the themes and plugins up to date across the sites, and the users database will be synced indirectly. Do you see any issues with this approach?

    Thanks again for the response,
    Adam

  • Timothy Bowers

    Well you could just update their IDs, but what about duplicate email addresses and then you need to check other tables for UIDs like posts and pages.

    As of now we're thinking about using a plugin to link the user databases between the sites, and then creating symbolic links on the server between the plugins and themes folders for each site. That way we can at least keep all of the themes and plugins up to date across the sites, and the users database will be synced indirectly. Do you see any issues with this approach?

    Tough one, I have no idea how your plugin will work or achieve this..... I suppose on paper it looks like it could work.

    If you were going to that extent then you could simply make an import plugin.

    I'd be interested in hearing about your progress as you go along. :slight_smile:

  • bobcatou

    Backup Buddy is an awesome program with good people behind it. Luckily I haven't had to use it to fix my site yet but I do use regularly to build sites locally for export later.

    I was thinking of going MultiSite but I have 3 WP blogs on my server. I debating about purchasing a second server account and just play with multisite on that account for a month before I changed my original server over. Now I am thinking that is a good idea.

    Bryan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.