Support » Plugin: WooCommerce » How to transfer local woocommerce without loosing orders history

  • Resolved fermanus

    (@fermanus)


    Hi,
    This is a basic question:
    Is it possible to work on a local clone, editing non-shop pages or posts, then replace the “real”, running, woocommerce site without loosing track of the latest orders.
    I though it would be easy by simply importing all woocommerce tables from the distant to local site then exporting everything back (folders and updated database) to my host. This way I anticipated the online site to benefit from all improvements made locally without loosing latest orders history. Then I learned (Github / woocommerce / database description) that orders are also stored as custom posts in the wp_post table (may be also in wp_post-meta?). If this is true it would mean that either I replace the distant wp_post table with the local one then I loose orders history or I don’t and I loose the redisigning work done locally.
    Is that correct? in which case I would have to rethink my approach, or am I wrong (I hope so). I hope the question is clear.
    Thanks for your help.

    • This topic was modified 5 months ago by  fermanus.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Stef

    (@serafinnyc)

    One of the best ways to do this is also with a Staged site. A lot of host are now offering the ability to migrate from live to staged and back to live. Not sure who you host is but that would be me one piece of advice. Look into that.

    Secondly you can migrate live site to local install no problem but chances are, and this is with any site, the data will change in between editing.

    I’d read more on the second part here.

    Depending on which local server you are running you’ll just want to Google “Installing WordPress Local Server”

    fermanus

    (@fermanus)

    Thanks for your answer or should I say “merci” as you are mutilingual. Joking apart, I have no problem working with a local server,I like XAMPP and I routinely, move non-woocommerce sites from live to local and occasionally the opposite. Doing this is no problem as the local site is an improved copy of the live site so I can simply erase the latter and replace by the local. This is different for woocommerce because one cannot simply replace everythoing and afford to loose client’s data. I was hoping that woocommerce would be using the wp_posts only for storing products as posts but that accounting details such as invoices or orders or client’s data etc. would be located in dedicated woo tables so that we can threat them separately from the wp_tables. If it is not the case then my brilliant idea is dead. So it all boils down to: what exactly does woocommerce save in the wp_post.

    I wonder again whether my way of describing the problem is clear.
    For your other questions, my host does not offer stage site and anyway, I would have a similar problem. So to conclude I think the best solution is to put the live site in maintenance mode and work there. Would you agree with that?

    Stef

    (@serafinnyc)

    Yeah, it’s a curse and gift. ;o)

    WooCommerce is dependant on WordPress core so you’ll find product data in the same wp_posts and wp_postmeta tables as posts and pages.

    You may want to read this
    https://docs.woocommerce.com/document/bundles/bundles-data-structures-storage/

    I understood your initial description well. It may come down to which data you are reimporting though. I’m constantly working on my wife’s live site for certain things but then I work on staged site(your local) for other things and migrating back. I’ll test in DB of staged first and then import to live DB so no one is the wiser.

    Yes, it is a lot of work but who’s to say Sally won’t place in order while I’m doing all that. Not worth it. From time to time I put her site in MMode to fix something or add something that I just have to do that way.

    It’s all going to come down to your tasks at hand at that time.

    fermanus

    (@fermanus)

    My last reply for this topic and then I promise to say “au revoir” and to not bother you anymore (for now)

    1. You quietly work at improving your site locally while the other site is busy registering lots of orders (mostly from Sally).
    2. Two days have passed. You are happy with what you achieved and decide to update your live site.
    3.Oops a difficult choice: When replacing wp_posts should I loose some orders or do I prefer to loose all my nice designing work.

    A possible answer: May be asking for help from the good old wordpress export / import friend to selectively transfer new orders and other relevant data from life to local site and check whether this is OK. I’ve never done this, will need to be thorougly checked but let’s hope…Interesting problem anyway.

    As promised : “au revoir”.

    Stef

    (@serafinnyc)

    I wouldn’t override a live site ever. Not good business. I think, you may be onto something with the import export. Maybe one of the mods knows better than me. Interesting indeed.

    I guess I’d ask myself what am I doing working on a table all the time to have to import export all the time? I’d start there.

    braehler

    (@braehler)

    You can install a plugin for staging like “wp-staging” if your host doesn´t offer a staging enviroment

    • This reply was modified 5 months ago by  braehler.
    fermanus

    (@fermanus)

    @braehler

    Thanks a lot for the suggestion. I looked at the plugin page and found it really interesting. I’ll think about it but I must say I am very happy with my local XAMPP install even if the environment is not exactly the same as that of my production server . It is so easy and fast to test things (especially functions) locally. I could probably have both.

    Plugin Support EtienneP

    (@etiennep)

    Hi @fermanus

    This is a question we actually see a lot, what to do with customer info and orders when moving from a local site to the live site.

    The export/import is what we generally suggest and using something like https://woocommerce.com/products/ordercustomer-csv-export/ and https://woocommerce.com/products/customerorder-csv-import-suite/ makes it easier.

    Plugin Support EtienneP

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.