• Resolved michael1508

    (@michael1508)


    Hi all,

    For one of my subsites I have developped a new version locally on my PC.

    The plan was to push it online by using a plugin like’ All-In-One WP Migration’. This sounded relatively easy, until I realized that it does not work with my Multisite.

    I found different premium packages, that would cover my case. But they are all pretty costly for my one off purpose.

    I am a mid experienced WP user. Is there a free, but safe way for me to replace my subsite with my local single site version?

    PS: I would be able to upload it to a different online WP installation, if that helps.

    Thanks,
    Michael

    • This topic was modified 11 months, 4 weeks ago by michael1508.
    • This topic was modified 11 months, 4 weeks ago by michael1508.
    • This topic was modified 11 months, 4 weeks ago by michael1508.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @michael1508

    You can try out Migrate Guru Plugin. It allows multisite migration for free.

    Moderator bcworkz

    (@bcworkz)

    The simplest way is to migrate a single site installation, then afterwards convert the installation to multisite.

    It is feasible to manually import a single site into a specific network site. First create a network site to receive the data. I recommend making a backup of this site’s DB data, even though it’s a virtually empty site. There could be useful information within you’ll want to have available. Make note of which table prefix is used for the subsite and what tables are subsite specific.

    Using the phpMyAdmin app on your local PC, rename your DB tables to use the same prefix as the multisite’s. The local site will cease to work, but the data within will remain intact. Export all the DB tables in SQL format that correlate to the subsite specific tables noted earlier, except the options table. Do not export options, users, usermeta, etc. You may restore the old prefixes after export to regain normal functionality.

    Via FTP, upload the contents of your local /uploads/ folder (the contents only, not /uploads/ itself) to the appropriate /uploads/sites/# folder. Study the folder structure of other sites to help you ensure you replicate the same structure when uploading.

    Using the phpMyAdmin app for your multisite’s hosting account, import the SQL export file you made earlier. Fully replacing any subsite specific table but options is fine, as long as the table name prefixes match.

    The options table is not so simple to fully replace. Examine the contents of your local options table and compare with the multisite version. You likely don’t need much from the local version other than maybe the theme mods. You can pick and choose what options data you want to migrate over to multisite. When importing, be sure there is no ID number conflict. You might need to edit the SQL file to eliminate conflicts. It’s a plain text file that can be edited in a plain text or programmer’s editor, assuming the file isn’t too large. After importing, ensure the receiving table’s autoincrement value (under the operations tab) is higher than the highest existing record ID.

    If all goes according to plan, the migrated site will appear to be working correctly, except the images are still being pulled form your local site. You need to update any localhost media URLs to reflect the proper path in /uploads/sites/#/, as well as updating the domain name. Use the Better Search and Replace plugin to do this, ensuring you only search in the related sub-site tables. After updating the media URLs, there are likely other localhost URLs that need to be updated. Do another search and replace for just the localhost domain, without /uploads/ being part of the search. We must address the media URLs first so the presence of “localhost” ensures we do not accidentally update any other media URLs in the DB.

    You likely noticed that no local user data was migrated. It’s best to manage users within the multisite environment. Attempting to import users from a single site is fraught with difficulties that are best avoided if possible.

    This all looks quite complicated. It’s not really as bad as it may appear, but it is not simple by any means. There are many places where things can go wrong. As long as you are careful to not destroy any data, any missteps can be recovered from. Don’t let fear of failure to prevent you from trying. We learn best from our failures 😉

    Thread Starter michael1508

    (@michael1508)

    Thank you very much for your quick responses. Also for the comprehensive instructions for the manual way.

    I have meanwhile also found another free plugin, which worked great. Prime Mover.

    Again, thanks for your help.

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Importing single site into Multisite’ is closed to new replies.