• Resolved nootkan

    (@nootkan)


    I’ve been tasked with migrating over two websites to our server from another server which normally is no problem for me and is done fairly quickly.

    However, this time the two sites are part of a multisite wordpress installation. They are the only two sites in the database. One is a woocommerce driven site and the other a normal content driven site. Neither one is very large.

    Here is what I’ve done so far: new wordpress install using wamp on my computer, transferring all woocommerce table data into new database, transfer all user data into new database, install all plugins used previously to new installation, check to see if changes affect the new installation.

    The problem I am having is transferring over the products and orders as I cannot find any tables that store this data. I’ve looked inside the wp_posts tables and don’t see any reference to woocommerce products. I’ve been to the woocommerce documentation along with wp documentation but cannot find any help there telling what the product naming structure is.

    Can anyone point me in the right direction on how to transfer over all the product and order data for each user etc? I’ve been at this for over a week researching and trying different solutions with no success.

    Even tried to find a plugin that would do it for me but there doesn’t seem to be one out there that I can find.

    Sorry for the long winded post but hopefully it makes sense and someone more skilled at separating multisites back to single sites can help.

    • This topic was modified 6 years, 1 month ago by nootkan.
Viewing 4 replies - 1 through 4 (of 4 total)
  • I’d forget the localhost idea unless you insist on it. Way too much noise!

    Engage a second host and migrate everything to there as a duplicate. And keep a copy of everything (don’t forget the database).

    I expect one of the two sites you wish to keep is also the main site of the initial WordPress. So that one is mostly done but keep it as is until…

    The other site probably contains the main site and the second site. You’ll need these instructions here. https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/.

    You’ll need to point the second domain at this site and get that working including convincing the server to ‘let that one in’.

    One the second site is working with its ‘new domain’ you can kill off the other account(s). And then follow these directions to revert back to a single site… https://www.artfulpussycat.com/reverting-wordpress-multisite-install-back-single-site/

    Test, make backups, test some more.

    Now that you’ve done this once in the safety of the duplicated site on the new environment you can kill off the extra sites in the original site (or you can leave things as they are for a time just in case).

    One more step when your done would be to run WPSweep across the whole database for each site and another backup of things as they now are would be great. Don’t forget to look at your users for each site. Kill the ones you don’t need. Consider each user as a possible vulnerability ‘just in case’.

    You might also look at the users tables in each database. If there’s something odd there like an orphaned user delete it then let WP Sweep clean up the mess in the options table.

    I like WP Sweep for working with possible problems in the database but once those are fixed I like the UpDraftPlus and WP Optimize plugins as they work well with each other.

    Same with security… I like iThemes Security paired with WordFence!

    Thread Starter nootkan

    (@nootkan)

    Thanks appreciate your advice and tips. However, I cannot do this live because of the potential loss of orders hence the need to do it via local host first.

    Using another host is out of the question also as the client won’t pay extra. I am currently doing everything manually but cannot find all the data for the orders yet.

    I was hoping to do everything on the local host and once finished upload to the same account after dropping database and files.

    Is there a plugin that separates the two websites from the mulitsite for you?

    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
    Thread Starter nootkan

    (@nootkan)

    Okay I found a site while browsing the links that JNashHawkins provided that gives me the tables where all the ecommerce data resides and I’ve moved it all over to the new database and will see how much more there is to move over to make the site function normal.

    If anyone else is wondering where the ecommerce data resides here is the tables I got from the site:

    Products are located mainly in 2 tables:
    wp_posts table with a post_type like product or product_variation,
    wp_postmeta table with the corresponding post_id by product (the product ID).

    Product types, categories, subcategories, tags, attributes and all other custom taxonomies are located in the following tables:
    wp_terms
    wp_termmeta
    wp_term_taxonomy
    wp_term_relationships
    wp_woocommerce_termmeta
    wp_woocommerce_attribute_taxonomies (for product attributes only)

    Thread Starter nootkan

    (@nootkan)

    Finally finished the separation and thought I’d list my steps here in case it works for someone else.

    This was done with a multisite that had three different websites with one of them being a woocommerce site (main site). There wasn’t a lot of data as the sites were only two years old.

    1. First I backed up everything!!

    2. Next I did a fresh install of wordpress on my local server using Wamp.

    3. Then I uploaded all the themes/plugins/upload folder from the backup into the fresh install and deactivated all plugins.

    4. Next I opened up both database sql files inside notepad++ so I could look over everything. Each website has a different prefix for their corresponding tables like wp_2_options, wp_3_options etc. The main website will be just the standard wp_options prefix. At least this is how it was for me.

    5. Then I copied the data from the 8 tables I listed in the post above into the new database overwriting the existing data in the same tables. I also copied over any other woocommerce table data from other woocommerce tables not listed as part of the 8 like wp_woocommerce_sessions, wp_woocommerce_order_itemmeta, wp_woocommerce_order_items etc.

    6. The things to watch for here are making sure to replace the comma at the end of the data with a semi-colon and that (if applicable) the column counts match the value counts or you’ll get an sql error when you import the new database.

    7. Next I copied over the data from the wp_options table to the new database again overwriting the existing data.

    8. After that I copied over all the wp_users, wp_users_meta table data to the new database again making sure that the column counts match the value counts and commas and semicolons are in their respective places.

    9. Next I went through all the plugin tables to copy over data that belongs to the individual website like formidable forms etc. Again each website will have its own prefix to let you know which is which (at least in my case).

    10. After I was sure that I had copied over all pertinent data for the website I was separating I went through all the tables to make sure the commas and semi colons and column/values were correct.

    11. Then I dropped my fresh installed database and imported the modified database for the separated website on my localhost (wamp). And of course I had a couple of errors relating to the comma’s and column/value counts which I went back and fixed.

    12. Then I activated all plugins and did some tweaking/testing of the functionality of the website on my localhost (wamp) to confirm that everything worked without issues, making sure I was online also to update any plugins/themes that needed it since I began.

    13. I deleted the live mulitsite installation/database and uploaded the single installation using ftp and importing the modified database using phpmyadmin. Yahoo no errors!

    14. Next I gave the live website a thorough going over and purchased a product to confirm that everything still worked without issues. Voila finished. Other than starting the same process on the other two websites of course. ?? ??

    This was a lot of work (2 full days) but the only way I could find to do what I wanted to do. I imagine that there is a plugin out there somewhere that does this for you but I couldn’t find it. There may also be a series of sql queries that you could do to lighten the workload but again I couldn’t find them.

    Hopefully this will help someone else like me (limited skills) to separate a multisite installation if that is what your client wants. If I remember any steps that I forgot to mention here I’ll stop back and add them but I believe that was all my notes for the process.

    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
    • This reply was modified 6 years, 1 month ago by nootkan.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Breaking up a Multisite Using Localhost on My Computer’ is closed to new replies.