Snapshot Pro 2.5 not restoring users on migration from single site to multisite

Hello,

I'm migrating single sites to a multi site network and after reading the article HOW TO MOVE A WORDPRESS SITE WITHOUT HASSLE WITH SNAPSHOT I decided to go ahead and try the plugin. Since mostly I'm the master admin for most of the sites, everything went well on the migrations, except on the sites that have other users.

I've ran numerous tests and the users are NOT restored well when migrating a single site to a non primary multi site.

On the restore screen it reads:

--- Quote ----
When restoring users and usermeta records under a Multisite environment there are a few limitations. Please read the following carefully:
1. If restoring to the primary blog ALL user entries will be replaced!

2. If restoring to a non-primary blog, the user's ID and user_name fields are checked against existing users.
- If a match is not found a new user will be created. This means a new user ID will be assigned.
- If a match is found but the user ID is different. The found user ID will be used.

3. If the restored user ID is changed, Snapshot will update usermeta, posts and comments records with the new user ID. A new usermeta record will be added with the key '_old_user_id' with the value of the previous user ID. Snapshot cannot attempt updates to other tables like BuddyPress where the user ID fields are not known. These will need to be updated manually.

--- end Quote ---

My case is #2 and the restore creates separate user and metadata tables on the subsite (i.e. wp_##_users & wp_##_metadata), does not create the new user and thus does not execute #3 above.

I will take a dive on the code and try to figure out where the problem is (asumming that it is not something I'm doing wrong).

Best regards

  • hgomezc

    Update: I'm currently debugging/tracing the code and still looking for the exact reason why this is failing. It took me quite some time to find where the magic is suppose to happen and then some more time figuring out how to debug this.

    file: snapshot.php
    function: snapshot_ajax_restore_convert_db_global_tables

    Since I'm not very familiar with wp development, the quickest way I've found to debug is to use the "$this->snapshot_logger->log_message" method to log entries on the log file on various "checkpoints" with custom messages and watching var values.

    Then I'm running the whole restore process again and inspect the log to "see" what happened. As you can guess, this is a bit cumbersome but at least I'm moving forward.

    It's a bit late for me, so I will be stopping now, but I'll be back after a good night sleep to move on.

  • Predrag Dubajic

    Hey @hgomezc,

    Hope you're doing well today :slight_smile:

    Thanks for reporting this in, I was doing some extensive testing about this issue and was able to replicate the issue you are having, I have notified plugin developer regarding this issue so he can investigate it further.

    If you find any additional info in the meantime please let us know and I'll make sure to send you some thank you points :slight_smile:

    Best regards,
    Predrag

  • hgomezc

    Hi! Any news from developer yet?

    I haven't been able to invest too much time on this as I have other priorities, but from where I am right now I can tell that the real fix it will not be a quick one. I'm not saying it's a difficult chore, it's just matter of applying a good set of rules (criteria) to properly import a bunch of existing users on several databases into a single db (this alone could easily become a mess) What I mean is that it requires a bit of planning to do it right.

    This Saturday could be the day I devote to fix this, but I'm not sure it is worth the time for my particular case, it would be far easier to let it as it is and fix it manually with a bunch of SQL statements applied directly to the database. I just have a handful of users on said database as the users are private to a small team of writers within a company. I'd rather wait for the developer to tackle this.

    The challenge of doing it is what motivates me to keep going on, but not sure if it worth it.

    In the meantime, if you're here reading this because you want to migrate a single stand-alone site with several users to a subsite on a network, don't rely on this tool (version 2.5) until this bug is fixed.

    Best regards

  • Adam Czajczyk

    Hello @hgomezc,

    I hope you're well today and thanks for sharing your findings with us!

    As my colleague @Predrag Dubajic has confirmed the issue and reported it to the developer, there's no fix available yet. I must agree with your diagnose that this may require some complex adjustments to the plugin's code/workflow logic, however I'm not in a position to speak for the developer.

    I can confirm though that he's working on it and hopefully will be able to come up with a solid solution as soon as possible.

    That said, either me or Predrag we will keep you updated here once we get to know more specific answer from developer. I apologize for the delay on this!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.