Codexonics
Forum Replies Created
-
Thanks, that’s great to hear! 🙂 Yes the hotfix script is usable as long as it is on the standalone/single-site and run by administrator with WC activated.
We are now currently finalizing the changes on Prime Mover 1.4.8 (next release) and this includes the fix for WooCommerce orders adjustment. We will release this as early as next week. So if you happen to migrate WC sites before Prime Mover 1.4.8 you can use the script to adjust/fix the orders. However using version 1.4.8 is recommended than using the hotfix script because it saves time and you don’t need to run any scripts/monitor logs/etc. But hotfix script can be used as last resort in case you need it.
Regarding other issues you’ve mentioned – sometimes those are necessary because there are plugins that are not migration friendly. This means that they are storing data that not easily transportable from one WP platform or another (e.g. from multisite to single site, vice versa).
A good example is when plugins hard code specific data (e.g. IDs, hashes, signatures, license keys, etc.) in their dB setting which might change when it gets migrated to another site. Or if they have multisite-specific setting and the plugin don’t have auto-adjust when migrated to stadnalone. It’s why re-activating/reconfiguration is needed for some plugins after migration.
Prime Mover plugin does it’s best when migrating things like this. It does search and replace (domain names, etc.), adjust vital important data (e.g. users), etc. However, it cannot handle all specialized migration scenarios introduced by all WP plugins. And this is where custom configuration after migration might still be necessary.
Moving on, I have marked this ticket as resolved since the main issue is solved. And then if you can provide us with reproducible steps (or WPRIME packages) for other problematic plugins during migration- please open another ticket so we can have a detailed look. We will handle it on our future releases if we could also reproduce it on our end and fix it inside Prime Mover. Thanks again!
It’s OK, no problem 🙂 I’ve also updated the hotfix script to version 5.0 with minor changes from v4 – run the code on plugin activation hook. This is to make sure it will run once only then deactivate the plugin automatically after processing. Also append hotfix version number on the log so we will know what version is running.
So when you run version 5.0 – it will show the version number like this in the log:
[10-Feb-2022 10:51:41 UTC] RUNNING VERSION 5.0 OF THE SCRIPT!You can download version 5.0 here. Thanks!
Thanks, that is strange because in the log you’ve sent. It starts with
[08-Feb-2022 14:54:28 UTC] Retrieving all ordersThis log output is only present before version 3.0 and version 4.0. If you’ve checked the version 4.0 code – the log string
Retrieving all ordersis not there.Anyway I’ll review this again today and try to reproduce the issue that you’ve reported. Thanks.
Thanks for the feedback and the log. We’ve checked it and it seems you are using the old version of the hotfix plugin script that will process only 10 orders with incomplete logs.
Can you please make sure you are using Version 4.0 of the script? You can download the latest version here.
To re-test – please restore to the original dB backup state first. Delete old versions of the hotfix plugin script and install version 4.0. Clear the debug.log. Once it’s sure it’s version 4.0 – activate the hotfix plugin script.
Version 4.0 processes all orders with complete logs. Please let me know if you still need assistance. Cheers.
OK just in case you want to test. The hotfix plugin script is modified to version 4.0. It’s now very simple – it simply checks for billing email and if user account exists. If it does – get the migrated user ID and set it to customer ID meta key for that order. For guest checkouts where customer ID is already 0 – it’s skipped.
To re-test – please restore to the original dB backup state first. Clear the debug.log. You can then install and activate hotfix plugin version 4.0.
Thanks and let me know if you still need assistance.
Thanks for the update. Glad to know it now processes all orders! By the way, that is weird to incorrectly detect guest purchase. It’s using the WC Order::get_user() which will return a user object and false for guests.
Moving forward with this – how about we check if every order has associated billing email. Then once that billing email is set – we query the
WP_Usertable if a user exist with that given billing email. If user exist in users table for that billing email – WC account exists.Then we get the migrated user ID and use it to update
_customer_userin post meta table for that order. Otherwise if user does not exist with the given billing email or if this billing email is not set in the order – we mark that as a guest order and set_customer_userto 0.Do you think this works for your case? We don’t have the package or db to test but we can propose some solutions to this. Thanks.
OK, the hotfix plugin script is now updated. To re-test:
- Backup your existing standalone site database.
- Download the latest hotfix plugin script.
- Install the hotfix plugin script to your standalone site.
- Make sure the hotfix plugin script is version 3.0.
- Make sure WooCommerce plugin is activated.
- Delete old
/wp-content/debug.logso that the log file contains the latest logs only. - Make sure WordPress debugging is enabled in wp-config.php.
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true);- Activate the hotfix plugin Migrate customer ID WC Orders
- Wait until the plugin is fully activated. When it does – check the logs for details and results. The log shows the total number of orders processed and all other details. It should process more than 10 orders now.
- Backup your debug.log so you will see the progress of the orders updating just in case you need to re-run it again if it hits timeout. This way we can tweak where to resume.
- Once done, check the customer accounts – orders should be connected.
That’s it 🙂 Hope this fix resolves your issue. Thanks!
Hi Dev, Yes that’s fine, also the user equivalence log is redacted. We are currently reviewing the hotfix plugin script so make sure it works for all orders not only the 10 most recent ones. I’ll update here again when this is ready. Thanks!
Thanks, that is strange indeed. It would be hard to debug/reproduce this without looking at your
WPRIMEpackage. Can you please share the originalWPRIMEpackage in Gdrive or any file share host and then send me the link to download it? We will check your package in our local to reproduce this issue.Once we got your package – please give us time to analyze. Thanks again.
Thanks for the update. Yes it looks like it but we will do some more testing on this aspect regarding guest purchases, etc. If you can send me the full log in your end that would be great so we will know how it processes the entire order set.
We did some test on the hotfix and it correctly detects guest purchases and customers with account. For example this is a full log:
[08-Feb-2022 15:29:00 UTC] Retrieving all orders [08-Feb-2022 15:29:00 UTC] Processing order [08-Feb-2022 15:29:00 UTC] ORDER ID: 16 [08-Feb-2022 15:29:00 UTC] BILLING EMAIL: xxx [08-Feb-2022 15:29:00 UTC] ORIGINAL CUSTOMER ID: 3 [08-Feb-2022 15:29:00 UTC] GET USER INFO BY BILLING EMAIL. [08-Feb-2022 15:29:00 UTC] MIGRATED USER ID: 5 [08-Feb-2022 15:29:00 UTC] UPDATING CUSTOMER ID ASSOCIATED WITH ORDER ID 16 WITH USER ID: 5 [08-Feb-2022 15:29:00 UTC] ORDER ID: 15 [08-Feb-2022 15:29:00 UTC] BILLING EMAIL: xxx [08-Feb-2022 15:29:00 UTC] ORIGINAL CUSTOMER ID: 0 [08-Feb-2022 15:29:00 UTC] GET USER INFO BY BILLING EMAIL. [08-Feb-2022 15:29:00 UTC] MIGRATED USER ID: 3 [08-Feb-2022 15:29:00 UTC] UPDATING CUSTOMER ID ASSOCIATED WITH ORDER ID 15 WITH USER ID: 3 [08-Feb-2022 15:29:00 UTC] ORDER ID: 14 [08-Feb-2022 15:29:00 UTC] BILLING EMAIL: xxx [08-Feb-2022 15:29:00 UTC] ORIGINAL CUSTOMER ID: 0 [08-Feb-2022 15:29:00 UTC] GET USER INFO BY BILLING EMAIL. [08-Feb-2022 15:29:00 UTC] NO USER ASSOCIATED WITH THIS BILLING EMAIL, BAIL OUT DONT PROCESS. [08-Feb-2022 15:29:00 UTC] ORDER ID: 12 [08-Feb-2022 15:29:00 UTC] BILLING EMAIL: xxx [08-Feb-2022 15:29:00 UTC] ORIGINAL CUSTOMER ID: 2 [08-Feb-2022 15:29:00 UTC] GET USER INFO BY BILLING EMAIL. [08-Feb-2022 15:29:00 UTC] MIGRATED USER ID: 4 [08-Feb-2022 15:29:00 UTC] UPDATING CUSTOMER ID ASSOCIATED WITH ORDER ID 12 WITH USER ID: 4 [08-Feb-2022 15:29:00 UTC] DONE PROCESSINGThere are 4 orders total in the above test and 4 customers. 2 are guest purchases and 2 users with accounts. After running the script/hotfix – the orders are re-aligned for those customers with accounts at the target standalone site.
I think you should have all the information you need to make this adjustment in your end. Also you can restore the site again to standalone Prime Mover and then re-run the hotfix script plugin to make sure you are getting consistent results. Please let me know if you still need help or assistance.
Hi Dev,
I’ve modified the hotfix to write some logs. Please re-download it here. It’s version 2.0 so make sure you install this.And then please enable WordPress debug first in your standalone site before activating this hotfix:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true);Once debugging is enabled, activate the hotfix plugin. Once done – it will automatically deactivate. The log should be written to
/wp-content/debug.logcontains sensitive information and don’t post it publicly.Please send it to us by logging into the standalone site and go to Prime Mover – Contact Us or you can send us via our contact form here.
The hotfix relies on customer billing email. If this is not set or not associated with a WP user , then the hotfix will not work.
Alternatively (if hot fix does not work) – during the time when you migrate the site to standalone. Prime Mover writes migration logs to ‘/wp-content/uploads/prime-mover-export-files/’ , search for file name with something like
XXXXXX_migration.logas the filename. Only check the latest restore log. You don’t need to restore the site again to your standalone as this migration log should already exist there.Download and open the log and look for the user equivalence log. It should look something like this:
`
[user_equivalence] => SplFixedArray Object
(
[0] =>
[1] => 3
[2] => 4
)
‘This log is important because it shows the user ID before (in your multisite source site) and after (in your target standalone) migration. For example in the above sample log. User ID 1 becomes User ID 3 at target site. User ID 2 becomes User ID 4 at target site. You can use this information to manually adjust the
_customer_usermeta_key associated with that WC order.We are now well aware of this issue and will be working on a permanent fix so they will automatically adjusted when migrating WC sites.
Our support timezone is GMT + 8 so in case you have follow-up questions. We will check on it with details on the next day. Thank you!
- This reply was modified 4 years, 4 months ago by Codexonics. Reason: Some typo
Hi Dev,
Thanks for using Prime Mover in your project! Sorry to hear you have migration issues. Regarding the unresolved issue on WooCommerce orders – it’s tricky one and we have reproduced this one in our test server.The issue is that the when the user is migrated to standalone – a different user ID is created because Prime Mover relies on
wp_insert_userfor new migrating new users to the site.When the new user migrated ID is different from the original customer ID (at multisite source) – then the WooCommerce order is disconnected from the original user at standalone.
To fix this and to re-align the customer IDs with the migrated user IDs. Can you please try the steps below:- Download this custom hotfix plugin.
- Install this to your standalone site and make sure WooCommerce plugin is activated.
- Now activate the plugin – “Migrate customer ID WC Orders“
- Depending on the number of WooCommerce orders, this can take time to loop over it to update the customer orders.
- You will know it’s done updating when the plugin is finally activated. If server timeout is reached – increase your server timeout and simply re-activate the plugin.
- Make sures to deactivate the plugin after this.
This should re-align the customer IDs associated with the WooCommerce order with the new user IDs migrated at the standalone site.
If you are still having issues with this – please provide us the download link of the
WPRIMEpackage used to migrate to standalone by contacting us here. We will debug your package further to see what’s wrong.If this works successfully – we will add a permanent fix to this issue inside Prime Mover plugin in the future releases. Thanks again for reporting this issue. Please mark this ticket as resolved if you don’t anymore need technical assistance. Cheers.
Forum: Reviews
In reply to: [Prime Mover - Migrate WordPress Website & Backups] Very impressiveHello Jack,
Thanks for giving us 5 stars and for sharing your experience with Prime Mover plugin. Cheers 🙂Hello John,
Thanks for giving us 5-stars and for sharing your experience with Prime Mover. Cheers 🙂Hello John,
Usually if you have this error – your server might be under powered with the current traffic you are experiencing or number of plugins/connections open at the same time. Upgrading to a more stable hosting platform is usually the best solution in this case.
Other quick solutions includes – deactivating resource hungry plugins and see if it helps. You mentioned in your original posts that the site has lots of unnecessary plugins. Maybe it’s time to review them one by one and deactivate those that are not needed. This way – you will drastically reduce the CPU and memory footprint of your site by using only plugins that you need.