• Resolved Caoba

    (@caoba)


    Hi, I am currently using the “WooCommerce Order Status Manager” plugin from SkyVerge, for many years, and I want to migrate to “Custom Order Status Manager for WooCommerce” plugin from Bright Plugins. I would like to know what would be the right way to migrate without affecting the customized status of existing orders, so that customers will not suffer this change. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Caoba

    (@caoba)

    Can you help me, please? @im_niloy

    Hi @caoba

    We haven’t tested the migration yet. I will inform the team about this, so I hope you will get a code snippet from us to make it work perfectly.

    Thread Starter Caoba

    (@caoba)

    Ok thanks, I will be waiting

    Hello, I hope my experience helps you.

    When migrating to this beautiful plugin
    I created order cases with the same previous names

    But I added some letters so that there would be no conflict with the old

    Example of the old:

    Slug / Shipped

    Example of the new:

    Slug / shipping

    And I stopped all notifications to customers and moved orders from the old section to the new

    I hope that the quick shipping explanation is clear to you

    And I wish you success

    And thank you for the really wonderful and beautiful addition

    And I hope to include these cases in the WooCommerce database

    Plugin Author Kleinmann

    (@kleinmannbrightvessel)

    Hello @caoba,
    I hope you are well

    Thank you @shakoor99 fot your suggestion on this, we appreciate it!

    Our steps for the migration would be as follows:

    Perform the following procedure first on your staging site; if everything goes well, then on your live site:

    1- Make a backup of the database.

    2- Create the new statuses with our plugin (the new plugin).

    3- Manually disable the email configuration that were generated for each new custom status (created in step 2) to prevent e-mails from being sent in the migration process ==> WooCommerce > Settings > Emails

    4- Use the following script to migrate the statuses – it takes all orders based on the old status and changes their statuses to the new one:

    /**
    * Migrate WooCommerce order statuses - Maximum for 1000 orders to be migrated
    *
    * This script will change the status of all orders
    * that match the indicated status (old status) to a new status (new status).
    *
    * Script created by Bright Plugins
    */
    if( !function_exists( 'bp_migrate_order_statuses' ) ) {

    function bp_migrate_order_statuses($old_status, $new_status) {

    // Get all orders with the old status
    $orders = wc_get_orders(array(
    'status' => $old_status,
    'limit' => -1, // Retrieve all orders
    ));

    foreach ($orders as $order) {
    // Change the status
    $order->set_status($new_status);
    $order->save();
    }

    echo '<pre>';var_dump( 'Migration attempt completed for: ' . $new_status );'</pre>';die;
    }

    add_action('wp_footer', function(){

    if (!is_user_logged_in() || !current_user_can('manage_options')) {
    return; // Exit if not an admin
    }

    /**
    * Put here the old status and the new status,
    *
    * $old_status => for the old status
    * $new_status => for the new status you want the orders to have.
    */

    $old_status = '';
    $new_status = '';

    /**
    * @param string $old_status The slug of the old status.
    * @param string $new_status The slug of the new status.
    */
    bp_migrate_order_statuses( $old_status, $new_status );
    });
    }

    5- Uninstall the old plugin.

    6- Verification of the orders.

    7- Done.

    I hope this can help you !

    – Best Regards

    Plugin Support mathdaniel

    (@mathdaniel)

    Hello,

    I hope you are well.

    As we haven’t received a response, I’ll mark this as resolved. Feel free to open a new topic if you continue encountering issues or reopen this topic; we’d be happy to assist. Thank you!

    Best regards, peace!

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