[Hosting] Staging to Live Push update

2

I think it will be really beneficial to have a check to see if database tables need to be updated and then update them rather than replacing the whole thing.

I am running an e-commerce store and need to update some product images, prices, and structures but cannot push that live because it will overwrite everything. This process of product updates is a massive one and there will definitely be orders coming through on the production and if I push staging to live it will remove those orders or any new products that I might of added in the mean time. I would think that this is a standard procedure rather than a full over write but clearly not. Am I mistaken or can this be done?

  • Alfredo Galano Loyola
    • Staff

    Hello Clinton dos Santos
    I hope you are doing well today.

    I think it will be beneficial to have a check to see if database tables need to be updated and then update them rather than replacing the whole thing.

    A feature like that will be great, unfortunately, something like that is almost impossible to achieve.

    WordPress Database is not complex, the main issue is some plugins like WooCommerce reuse WordPress Core tables to save their data.
    [attachments are only viewable by logged-in members]
    [attachments are only viewable by logged-in members]
    For example, the products of WooCommerce are saved in the same table as the posts and pages are saved, if you create a Staging site to modify a product page, you make all the modifications in the Staging but during that time a new post, Forminator Pro form or any other plugin that use the wp_posts table added some data on it, then when you move Staging to Live, even with the option to select what tables replace or if the system could automatically check for tables to update, always some data could be lost.

    Even if possible create a tool capable of inspecting specific tables to only try to update specific rows of data the Live site could have rows with the same IDs and will cause a conflict to merge, losing data or causing issues in WordPress and plugin behaviors.

    I am running an e-commerce store and need to update some product images, prices, and structures but cannot push that live because it will overwrite everything.

    Update product images and prices could be considered a minor update, for those you can create a Backup of the Live site, or sync the Live site to Staging, then do the modification on the Live site, if something goes wrong, restore from the Backup or from Staging.

    For structure changes on the product page design or the site design, the best is to use Templates, these templates could be from Page Builders, WordPress Gutenberg Blocks, or WordPress PHP Templates, you can set the Staging site, build the Template on it, then change the structure of the products pages and other sites pages and posts when everything looks great then you can export those templates and import on the Live site.
    If you will be using images and media files in those templates, you upload them first on the Live site before creating the Staging site, that way when you apply later the template on the Live site, everything will be fine.

    If you are using a Page Builder like Elementor, you can even in the Live site, create a test page, start the creation of the Template and only apply to that specific test page, then make all the work in the template and when everything looks good for you, then you can apply on all the products pages.

    Of course, it will be always a good idea to create a Backup and move Live to Staging to keep a copy of it.

    For complete site redesign, the recommended is to put the site in Maintenance/Coming Soon mode, move Live to Staging, make all the changes there, and then when everything is ready move Staging to Live.

    Of course, it will need a detailed plan and you should put the site offline, when you are ready to do it and in days or seasons where the sales will be lower.

    In the resume, adding a feature that allows manually excluding specific tables could be possible, but there’s still the risk of losing/replacing some data because of how WordPress and plugins store the data on the Database.

    Please, let us know if you are interested in adding a Feature Request that allows manually excluding tables when moving Staging to the Live site.

    I hope this answer helps you.

    Best regards,
    Alfredo