Migrating Orders and Customers into M2 store

Hello,
we have a M1 store with 17k orders and 600 customers accounts. We have set up an completely new M2 store with new category and store setup. All products are finished and have diferent structure (ID and SKU). Now we wanted to import all old existing customers and order related files from M1.
we run into issues. When importing all necessary files, the frontend is breaking, because the store fails to switch to correct store id (after import we have our new M2 store setup and the new migrated Store from M1 causing trouble). Backend is working, all orders are fine, frontend not working though.
if we delete the migrated storefront, the frontend is working fine again, but in backend we can not view and print the 17k migrated orders from M1.
 
how can we solve this issue so wen can use the old invoices and orders, but not having to import old store and products? If thats not possible, how to fix the store ID issue then?

  1. Profile photo of wudesignswudesigns 110.00 $tone April 30, 2018
    Error on Frontend after full migration:Fatal error: Uncaught Error: Call to a member function getCode() on null in /home/wudesign/public_html/vendor/magento/module-store/App/Action/Plugin/Context.php:90 Stack trace: #0 /home/wudesign/public_html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Store\App\Action\Plugin\Context->beforeDispatch(Object(Magento\Cms\Controller\Index\Index\Interceptor), Object(Magento\Framework\App\Request\Http)) #1 /home/wudesign/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #2 /home/wudesign/public_html/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array) #3 /home/wudesign/public_html/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #4 /home/wudesig in /home/wudesign/public_html/vendor/magento/module-store/App/Action/Plugin/Context.php on line 90

11 answers

Profile photo of Mall Staff 184060.00 $tone April 30, 2018
Public

Hi there,

When importing all necessary files, the frontend is breaking, because the store fails to switch to correct store id 

Could you provide me more information about that issue?

(after import we have our new M2 store setup and the new migrated Store from M1 causing trouble)

That because you have not checked to ‘merge default website’ option in settings in step #2 of our tool.

if we delete the migrated storefront, the frontend is working fine again, but in backend we can not view and print the 17k migrated orders from M1.

You shouldn’t do that. If you have did that in current Magento2 instance. Please re-start data migration in all steps in a new Magento2 instance. And if you get issue, let’s pause at that point time and provide me information about your Magento2 instance as followings:
+ Admin credentials and back-end url
+ SSH credentials and web root path to your Magento2 folder.
I will help to check further and help you out.
Regards,
Mall.
 

#1
Profile photo of Mall Staff 184060.00 $tone April 30, 2018
Public

Hi there,

how can we solve this issue so wen can use the old invoices and orders, but not having to import old store and products? If thats not possible, how to fix the store ID issue then?

If you want to migrate sales data you must do migrate for associated websites and store too. And you should select ‘Merge Default Websites’ option in settings in step #2 of our tool.
Regards,
Mall.

#2
Profile photo of wudesigns 110.00 $tone May 1, 2018
Public

Hello Mall,
if you like, just start the Migration with Merging stores at Step 2. You will see that nothing will happen anyway.
Only if I choose NOT to Merge Stores, then I can proceed to Migrate all other steps, but as you said, that is not what we want.
 
Best regards
alex

#5
Profile photo of wudesigns 110.00 $tone May 1, 2018
Public

Hello Mall,
I have been running the Migrating Process, have checked the box for Merging the stores as you suggested. But now again the frontend is broken showing following Message:

Fatal error: Uncaught Error: Call to a member function getCode() on null in /home/wudesign/public_html/vendor/magento/module-store/App/Action/Plugin/Context.php:90 Stack trace: #0 /home/wudesign/public_html/vendor/magento/framework/Interception/Interceptor.php(121): Magento\Store\App\Action\Plugin\Context->beforeDispatch(Object(Magento\Catalog\Controller\Product\View\Interceptor), Object(Magento\Framework\App\Request\Http)) #1 /home/wudesign/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Controller\Product\View\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #2 /home/wudesign/public_html/generated/code/Magento/Catalog/Controller/Product/View/Interceptor.php(26): Magento\Catalog\Controller\Product\View\Interceptor->___callPlugins(‘dispatch’, Array, Array) #3 /home/wudesign/public_html/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Product\View\Interceptor->dispatch(Object(Magento\Framework\App\Reques in /home/wudesign/public_html/vendor/magento/module-store/App/Action/Plugin/Context.php on line 90

You can also see the issue in frontend: http://www.fighters-store.com
 
Best regards
alex

#6
Profile photo of Mall Staff 184060.00 $tone May 2, 2018
Public

Hi there,
I have checked in your instance and I saw the issue as you mentioned. And I have simply open and click to the save button for Default website, Default store, Default store view (Web Shop >Wu Design >Deutsch)
And the issue was solved: http://i.prntscr.com/qbL39cf8QdKVHTWgrePMtQ.png
Let’s have a look again. And continue with data migration in other steps of our tool.
And contact me if you need further assistance.
Regards,
Mall.

#8
Profile photo of wudesigns 110.00 $tone May 2, 2018
Public

Hello there Mall,
thank you, this simple mistake we made was the root of the whole issue. Now migration worked with all customers and orders flawlessly.
I had one small issue though which I can not completely solve myself.
We have many new products in M2 shop which did not exist in M1 yet. Some products were exactly the same and have been merged. And some products from M1 have just been migrated but deactivated because we need them only in order for the sales data to work properly.
The issue is:
From M1 products the tax class has been imported and applied for all M1 products as well as the merged products from M2. This Tax class is showing corretly in Frontend.
All NEW products from M2 had a properly assigned and working Tax rule as well, but since Migration, the Tax rule is applied 2 times for some reason. My best guess is that the tax is applied one time from M1 rule and another time from M2, but I can not find the issue in Backend to solve this problem.
In Frontend you can see: http://www.fighters-store.com, The products without image are the merged products from M1 and M2. Their tax calculation is correct. Backend Price from product is set INCLUDING tax and showing in frontend accordingly. But all Products with images are new ones from M2 that have been there before migration and shall remain there as well. But now the backend price (set Including Tax) is added another extra 19% tax now.
Please assist. Can I override the merged M1 and M2 products tax rule to the new M2 rules? And how to remove the 2nd time applied taxes so the tax calculation is correct as before migration?
 
Best regards
alex

#9
Profile photo of Mall Staff 184060.00 $tone May 2, 2018
Public

Hi there,

Please assist. Can I override the merged M1 and M2 products tax rule to the new M2 rules? And how to remove the 2nd time applied taxes so the tax calculation is correct as before migration?

You could edit the tax rules in back-end of your site after migrated. Our tool only helps to migrate and it doesn’t merge or changes about tax calculation.
Regards,
Mall.

#10
Profile photo of wudesigns 110.00 $tone June 1, 2018
Public

Hello there,
new attempt to import database from M1 I ran into the following issue during import of sales orders:
 
2018/06/01 23:34:03 -- [Processing] Step #7 migration completed with 100 Sales Orders; 2018/06/01 23:34:29 [error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘street’ at row 1. The SQL statement executed was: INSERT INTO `quote_address` (`quote_id`, `updated_at`, `save_in_address_book`, `same_as_billing`, `collect_shipping_rates`, `weight`, `subtotal`, `base_subtotal`, `subtotal_with_discount`, `base_subtotal_with_discount`, `tax_amount`, `base_tax_amount`, `shipping_amount`, `base_shipping_amount`, `discount_amount`, `base_discount_amount`, `grand_total`, `base_grand_total`, `free_shipping`, `created_at`, `address_type`, `email`, `firstname`, `lastname`, `company`, `street`, `city`, `region`, `region_id`, `postcode`, `country_id`, `telephone`, `shipping_tax_amount`, `base_shipping_tax_amount`, `applied_taxes`, `subtotal_incl_tax`, `shipping_incl_tax`, `base_shipping_incl_tax`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, :yp22, :yp23, :yp24, :yp25, :yp26, :yp27, :yp28, :yp29, :yp30, :yp31, :yp32, :yp33, :yp34, :yp35, :yp36, :yp37)
 
About 400 orders are missing and due to error we can not finish the import process. Please tell how to proceed.
 
Best regards
alex

#11

This question is now closed

Written By

Comments