Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delta changes not migrated #316

Closed
rg-srini opened this issue Jun 8, 2017 · 45 comments
Closed

Delta changes not migrated #316

rg-srini opened this issue Jun 8, 2017 · 45 comments
Labels

Comments

@rg-srini
Copy link

rg-srini commented Jun 8, 2017

We completed the migration successfully. When we try to do the delta changes we get the below warnings. And the delta changes were not at all carried out for the entities (orders, invoices, shipments, returns, credits, customers, transactions, reviews).

[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: Custom Customer Attributes Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: Custom Customer Attributes Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_order
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_order_address
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_quote
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_quote_address
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: Customer Attributes Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: Customer Attributes Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_entity
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_entity_int
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_entity_text
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_entity_varchar
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_address_entity
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_address_entity_int
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: Map Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: Log Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: Log Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: customer_visitor
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: SalesOrder Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: SalesOrder Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: sales_order
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: OrderGrids Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: OrderGrids Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: sales_order_grid
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: sales_invoice_grid
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: sales_shipment_grid
[2017-06-08 10:29:26][WARNING]: Mismatch of entities in the document: sales_creditmemo_grid
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: delta delivering][step: SalesIncrement Step]: started
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: started
[2017-06-08 10:29:26][WARNING]: Mismatch in last increment id of order entity
[2017-06-08 10:29:26][WARNING]: Mismatch in last increment id of invoice entity
[2017-06-08 10:29:26][WARNING]: Mismatch in last increment id of creditmemo entity
[2017-06-08 10:29:26][WARNING]: Mismatch in last increment id of shipment entity
[2017-06-08 10:29:26][WARNING]: Mismatch in last increment id of rma_item entity
[2017-06-08 10:29:26][WARNING]: Volume Check failed
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: Migration completed successfully
[2017-06-08 10:29:26][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: Automatic restart in 5 sec. Use CTRL-C to abort
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: Custom Customer Attributes Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: Custom Customer Attributes Step]: started
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_order
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_order_address
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_quote
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: magento_customercustomattributes_sales_flat_quote_address
[2017-06-08 10:29:31][WARNING]: Volume Check failed
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: Customer Attributes Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: Customer Attributes Step]: started
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_entity
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_entity_int
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_entity_text
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_entity_varchar
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_address_entity
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_address_entity_int
[2017-06-08 10:29:31][WARNING]: Volume Check failed
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: Map Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: Log Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: Log Step]: started
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: customer_visitor
[2017-06-08 10:29:31][WARNING]: Volume Check failed
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: SalesOrder Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: SalesOrder Step]: started
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: sales_order
[2017-06-08 10:29:31][WARNING]: Volume Check failed
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: OrderGrids Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: OrderGrids Step]: started
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: sales_order_grid
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: sales_invoice_grid
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: sales_shipment_grid
[2017-06-08 10:29:31][WARNING]: Mismatch of entities in the document: sales_creditmemo_grid
[2017-06-08 10:29:31][WARNING]: Volume Check failed
[2017-06-08 10:29:31][INFO][mode: delta][stage: delta delivering][step: SalesIncrement Step]: started
[2017-06-08 10:29:31][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: started
[2017-06-08 10:29:32][WARNING]: Mismatch in last increment id of order entity
[2017-06-08 10:29:32][WARNING]: Mismatch in last increment id of invoice entity
[2017-06-08 10:29:32][WARNING]: Mismatch in last increment id of creditmemo entity
[2017-06-08 10:29:32][WARNING]: Mismatch in last increment id of shipment entity
[2017-06-08 10:29:32][WARNING]: Mismatch in last increment id of rma_item entity
[2017-06-08 10:29:32][WARNING]: Volume Check failed
[2017-06-08 10:29:32][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: Migration completed successfully

Note: we have not changed anything on the M2 DB post data migration other than adding few custom customer attributes. We tried to initiate the delta migration after a week time.

Please help. We highly rely on this tool.

@victor-v-rad
Copy link
Collaborator

the delta changes were not at all carried out for the entities

Did you make a comparison what exactly records are missing? for example in customer_entity table of M1 and M2 stores

@rg-srini
Copy link
Author

rg-srini commented Jun 8, 2017

The m1 db has higher number of records and m2 db has lower number of records.

MariaDB> use m1;
MariaDB> select count(entity_id) from customer_entity;
+------------------+
| count(entity_id) |
+------------------+
| 922327 |
+------------------+
1 row in set (0.40 sec)

MariaDB> use m2;
MariaDB> select count(entity_id) from customer_entity;
+------------------+
| count(entity_id) |
+------------------+
| 917629 |
+------------------+
1 row in set (0.40 sec)

Also all of our m2_cl tables became empty on M1 DB, though there was no delta migration happened.

@victor-v-rad
Copy link
Collaborator

Usually for every new record in customer_entity of M1 new record to m2_cl_customer_entity should be added by MySQL triggers. Check this table

@rg-srini
Copy link
Author

rg-srini commented Jun 8, 2017

Please see below what we did:

  1. Took Live M1 DB dump and imported into a separate DB (m1_local)
  2. Then run the settings and data Migration. This worked fine.
  3. After a week, took another Live M1 DB dump and imported into m1_local
  4. Then ran the delta command to process the delta changes.

Could you please confirm whether this approach is correct?

Thanks,
Srini

@victor-v-rad
Copy link
Collaborator

Not really correct. Normally, the tool must connect to Live M1. As soon as you run bin/magento migrate:data delta tables m2_cl_* and triggers trg_* are setup on DB of M1 store. Triggers watch for changes in tables like customer_entity and add new records to m2_cl_* tables as a log. Delta mode reads m2_cl_* to transfer records were added/changed/removed.

Now, to fix delta you can fill m2_cl_* tables (find the list in deltalog.xml.dist) with missing records and run bin/magento migrate:delta again.

  1. Firstly you need to setup m2_cl_* tables again on your m1_local. To do this you need to delete all steps in your config.xml in <steps mode="data"></steps> scope.
  2. Then run bin/magento migrate:data. Now you have m2_cl_*.
  3. After, make a comparison (probably by SQL query) with M2 of what records have been changed/removed/added in tables listed in deltalog.xml.dist file.
  4. Fill m2_cl_* tables and run delta again.
  5. And do not forget, you added some new custom customer attributes to your M2. It might add a bit more headache.

@rg-srini
Copy link
Author

rg-srini commented Jun 9, 2017

@victor-v-rad - Thanks a lot for your suggestion. I believe your solution will fix our issue.
Will update further.

@croxarens
Copy link

@victor-v-rad I've applied the changes you suggested, and I still getting the same errors perhaps seems the delta migration is working more on something.
Unfortunately the number of customers and orders still the same even if I filled the m2_cl_ tables with the latest data.

Just to be sure, I filled the m2_cl tables with the INTs of column marked as PRIMARY and as "operation" I used "INSERT" then "processed" as 0

e.g.
INSERT INTO m2_cl_customer_address_entity_int VALUES (110417, 'INSERT', 0);

After that I run the delta migration, the records are disappearing from the m2_cl_ tables, I guess because processed, but the rest of the DB seems the same and in the Admin area the latest customer and order is the same there was before the delta migration.

@croxarens
Copy link

@victor-v-rad moreover I repopulated the <steps mode="data"></steps> inside the config.xml file as no operation was done otherwise.

@croxarens
Copy link

@victor-v-rad I guess it was a matter of cache, now all the new data are showing in the Admin area. 👍

@rg-raghu
Copy link

@victor-v-rad
We followed your suggestion of deleting the triggers and populating m2_cl_* tables manually and the delta migration is successful for customers, customer address, sales quote, sales order, sales invoice, sales shipment, rma, credit memo, review, rating, wishlist, etc.

Even though the delta migration is successful, we got the warnings "Mismatch in last increment id"

[2017-06-13 14:03:09][INFO][mode: delta][stage: delta delivering][step: SalesIncrement Step]: started
[2017-06-13 14:03:09][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: 1 sec
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of order entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of invoice entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of creditmemo entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of shipment entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of rma_item entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Volume Check failed

We checked both M1 and M2 tables and found that the
order entity id, invoice entity id, credit memo entity id, shipment entity id, rma item entity id
is same in both M1 and M2 tables.

Below is the full delta migration log.

php magento migrate:delta -r magento\data-migration-tool\etc\ee-to-ee\1.13.0.0\config.xml
Reset the current position of migration to start from the beginning

[2017-06-13 14:02:53][INFO][mode: delta][stage: delta delivering][step: Custom Customer Attributes Step]: started
......................
[2017-06-13 14:02:54][INFO][mode: delta][stage: volume check][step: Custom Customer Attributes Step]: started
100% [============================] Remaining Time: 1 sec
[2017-06-13 14:02:54][INFO][mode: delta][stage: delta delivering][step: Customer Attributes Step]: started
..........................................................................
[2017-06-13 14:02:56][INFO][mode: delta][stage: volume check][step: Customer Attributes Step]: started
100% [============================] Remaining Time: 1 sec
[2017-06-13 14:02:56][INFO][mode: delta][stage: delta delivering][step: Map Step]: started
.....................................................................................................................................................................................................................................
[2017-06-13 14:03:06][INFO][mode: delta][stage: delta delivering][step: Log Step]: started
..
[2017-06-13 14:03:06][INFO][mode: delta][stage: volume check][step: Log Step]: started
100% [============================] Remaining Time: 1 sec
[2017-06-13 14:03:06][INFO][mode: delta][stage: delta delivering][step: SalesOrder Step]: started...
[2017-06-13 14:03:07][INFO][mode: delta][stage: volume check][step: SalesOrder Step]: started
100% [============================] Remaining Time: 1 sec
[2017-06-13 14:03:07][INFO][mode: delta][stage: delta delivering][step: OrderGrids Step]: started
........................................
[2017-06-13 14:03:09][INFO][mode: delta][stage: volume check][step: OrderGrids Step]: started
100% [============================] Remaining Time: 1 sec
[2017-06-13 14:03:09][INFO][mode: delta][stage: delta delivering][step: SalesIncrement Step]: started
[2017-06-13 14:03:09][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: 1 sec
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of order entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of invoice entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of creditmemo entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of shipment entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Mismatch in last increment id of rma_item entity�[0m
�[0;33m[2017-06-13 14:03:09][WARNING]: Volume Check failed�[0m
[2017-06-13 14:03:13][INFO][mode: delta][stage: volume check][step: SalesIncrement Step]: Migration completed successfully

Thanks,
Raghu

@victor-v-rad
Copy link
Collaborator

The SalesIncrement delta step takes data from eav_entity_store table of M1 and migrate last increment ids into sequence_order, sequence_invoice, sequence_creditmemo, sequence_shipment, sequence_rma_item tables. Make sure you filled m2_cl_eav_entity_store table with appropriate data.

@MoMannn
Copy link

MoMannn commented Jun 15, 2017

@croxarens @rg-srini Hi I have the same problem (I made a copy of the live database and made a migration on that so delta is now not working). And since you two have seem to solve the problem? I am wondering if there is any possibility to share the sql script made to repopulate the m2_cl tables (I am guessing you didn't do it manually) so I don't have to write it from scrach. I would really appreciate it.

@rg-srini
Copy link
Author

@victor-v-rad - The suggested solution worked fine now we see the delta data on the admin. Thanks a lot. 👍

@victor-v-rad
Copy link
Collaborator

Glad it worked out )

@MoMannn
Copy link

MoMannn commented Jun 23, 2017

@croxarens @rg-srini asking you both again if you could share the sql-s created to fill the missing m2_cl tables data I made the same mistake of transfering data from a dump of the original database and would now like to do the delta migration directly to original database and any existing sql would really help me speed the process.. If you are willing to share..

@rg-srini
Copy link
Author

@MoMannn - See below the steps what we did.

  1. Created a table delta_log with 3 fields (m1_table, last_id, last_update)
  2. Populated this table with 89 records (ie. m1 table_names)
  3. Created a script (delta_meta.php) to update the last_id and last_update for each delta entity from m1 db.
  4. Upon completing first migration, updated the delta_log table using the above script (ie. with last_id and last_update of each m1_table)
  5. dropped all triggers from m1 db
  6. imported the latest sql dump into m1 db
  7. Created a script (delta_entries.php) to populate m2_cl_* tables (identify the new and updated entity_id's and fill the m2_cl_* tables)
  8. Executed the delta migration command.

@MoMannn
Copy link

MoMannn commented Jun 28, 2017

@rg-srini
Hm.. Well to explain my situation.

I made a dump of m1 database and migrated to m2. Now, after a month or so I would like to migrate the changes that where made to m1 in the mean time.

I ran the delta migration directly on m1 so that the tables m2_* and triggers are created but the delta doesn't run trough because of the id problem.

So I figured I need to populate the m2_* tables with the missings ids from the live m1 database so I could establish a delta connection.

But I'm not sure your answer does that since you are dropping triggers and importing the latest dump? or am I missing something?

@croxarens
Copy link

@MoMannn
After you have created the m2_* tables in your M1 DB, you need to populated them with the ID of the records which needs to be Inserted/Updated/Removed in M2.

Then you can run the delta migration.

@MoMannn
Copy link

MoMannn commented Jun 29, 2017

Ok.
What about the data that was generated when I first tried to start delta (that created the m2_tables and populated some with data already)? That data is ok right? I just need to add the missing records manually right?

@croxarens
Copy link

All the m2_* tables should be empty, so when you run the delta migration the records there are processed accordingly and removed from the m2_* table.

The m2_* tables have been created during the data migration

@MoMannn
Copy link

MoMannn commented Jun 29, 2017

ok, so I should first empty all the data inside the m2_* tables
the populate them manually with the missing data in magento2 database if I understand correctly.

Is there any document that shows which m2_* tables points to which magento2 tables? So I can check the last id in the magento2 corresponding table.

And I am guessing I should make updates to all the customers aswell since I don't know which where changed.

Thank you in advance for the info.

@croxarens
Copy link

The m2_* tables where all empty after the data migration, so I populated them accordingly.
Each m2_ table has the same name of another table in the M1 database.

e.g.
m2_cl_sales_flat_order == sales_flat_order

@MoMannn
Copy link

MoMannn commented Jun 29, 2017

My m2_* tables have some data inside for some reason.. Maybe because I tried delta migration even tho it failed?

Ah stupid me I still have the original dump I made for the data migration so I can just use that to compare with the live version. Thanks.

@MoMannn
Copy link

MoMannn commented Jul 18, 2017

I created a simple script that fixed this problem for me by connection to the magento 1 dump and magento 1 live database and checked for changes than added them to the m2_cl_* tables as insert statements.

If anyone has the same problem they can check the script here: https://github.com/MoMannn/delta_migration_script

It is poorly written and slow but does the job.

@karamdeep-singh
Copy link

@MoMannn
Thanks, it's working.

@meezin
Copy link

meezin commented Sep 29, 2017

@MoMannn I was trying to use your delta_migration_Script but i don't know how to use it.
What is connect.php file ? could you give me a hand for me a little bit?

I have a live site, a staging site(M v.1.9) and a dev site for M2.
A live site in on A server
A staging site, which is clone site for live site and dev site is on B server.
I can't find the way to migrate live site to dev site directly because they are on different DNS server.
I should clone all of database to staging site and run migration tool, anyway.
I already ran data mode from staging site to dev site.
I restored database to staging site from live site newtly to run delta mode for dev site.
I tried delta mode migration. However i faced the same issue on post where #316 is
I will run your script under public_htmlwhich i wrote as

  • $conm1 = mysqli_connect("localhost","dev_m2"," ","dev_m2");
  • $conm2 = mysqli_connect("localhost","staging","","staging");

++ I have a question here : I'm a quite newbie to run script file.

  1. Where do i put this file? under usr/bin?
  2. What is the connect.php?

I will wait for your reply.

@MoMannn
Copy link

MoMannn commented Oct 3, 2017

This is what connect.php includes:

function conm1()
{
ob_start();

$host = "host";
$upImeBaza = "username";
$gesloBaza = "password";
$imeBaze = "databaseName";

$conn = mysqli_connect($host, $upImeBaza, $gesloBaza, $imeBaze);
mysqli_set_charset($conn, 'utf8');
ob_end_flush();
return $conn;

}

function conm2()
{
ob_start();

$host = "host";
$upImeBaza = "username";
$gesloBaza = "password";
$imeBaze = "databaseName";

$conn = mysqli_connect($host, $upImeBaza, $gesloBaza, $imeBaze);
mysqli_set_charset($conn, 'utf8');
ob_end_flush();
return $conn;

}

You can put the script anywhere on the server you just need to make sure it can connect to both databases.

I would advice you to connect directly M1 database and migrate via default migration tool since that makes things much simpler.

@meezin
Copy link

meezin commented Oct 3, 2017 via email

@Steelfirebat
Copy link

Hi Momannn,

Would you please help me? I am having exactly the same problem with yours and figured out how it works after the fact... Anyway, I used your script and this is what I got:

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /srv/www/mydomain.com/delta.php on line 321
EndPHP Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /srv/www/mydomain.com/delta.php on line 343

Can you please tell me what I did wrong?

Thanks so much for your help!

Don

@peterjaap
Copy link

peterjaap commented Feb 16, 2018

I created a magerun command to retro-actively populate the m2_cl tables in the M1 installation; https://github.com/peterjaap/magerun-addons#create-changelog-entries-for-magento-2-data-migration-tool-delta-migration

Here are the queries to create the m2_cl tables in M1 db (not the triggers though); https://gist.github.com/peterjaap/97431fddad0e2015fccbfd961f15d239

@maurixxxx
Copy link

@peterjaap i'm trying your magerun addons to populate the m2_cl tables in my M1 database but when i run the n98-magerun.phar m2-migration:delta-update-changelog command i get the "There are no commands defined in the "m2-migration" namespace" error. And this go for all the other commands. I guess it is a misconfiguration problem can you get me on the right way pls? I installed your module following the read.me instruction in the .n98-magerun/modules/ directory, i'm using the Magento1 magerun version. What i'm missing? Thank you

@ZayLong
Copy link

ZayLong commented Jan 29, 2019

Came looking for a solution to the same problem.
@peterjaap You saved the day, you are the MVP

@udhayakumard10
Copy link

@victor-v-rad ,

Can you confirm delta command working fine in migrate product information M1 into M2?

@victor-v-rad
Copy link
Collaborator

I have not tried the script above

@drinkingsouls
Copy link

Hi,
I have an issue with Delta missing certain products, customers, orders.
I think this occured as I had run a delta and then revised to an earlier version of the database. I now cannot delta back the changes. Any new data seems to be going across but nothing in the gap between the database backup and now will migrate.
Does anyone have any solutions that worked for this?
Thank you.

@Ckaneriya
Copy link

@MoMannn

I created a simple script that fixed this problem for me by connection to the Magento 1 dump and Magento 1 live database and checked for changes than added them to the m2_cl_* tables as insert statements.

If anyone has the same problem they can check the script here: https://github.com/MoMannn/delta_migration_script

It is poorly written and slow but does the job.

I have tried your script but I think it is not working in my case.

Let me explain what we did:

we have freshly installed 2.3.5-p1 and we have connected it to our live M1 database and performed first data migration and all the data and settings were migrated successfully. Approximately 2 -3 weeks after doing first data migration we have placed 3 test orders in the M2 website and additionally client created some products in the M2. after that we tried to perform a delta migration but we got an integrity check error. So we have deleted new products which we suspect was created by the client in M2 and attempted delta migration again. the delta migration executed with so many warnings but without any errors. We thought the delta migration was successful but new data was not migrated into M2 at all.

So, we have created two databases, in one DB we have dumped the DB of live M1 site and in another one, we have dumped DB of M1 website which we have backed up after first data migration and before delta migration and I executed your script between these two databases. but when I check the databases I noticed that no changes were moved to any of the databases.

what could be happened in this situation?

@Vishrootways
Copy link

@MoMannn Your script is working well for us, thank you. (Need to do few changes in code but it's working)
We have one question: We found that many tables are missing in script.php like all the tables of "m2_cl_catalog_product_entity_" and many more. So no need to add those tables or you just added only few tables to show sample code and we have to add all tables from our side?

@MoMannn
Copy link

MoMannn commented Jun 23, 2020

@Vishrootways I only added those that I needed for my project. Feel free to update and modify the script to your needs.

@MoMannn
Copy link

MoMannn commented Jun 23, 2020

@Ckaneriya Well this is not really the situation for which the script was created but I believe you could modify to suite your purpose.

@Vishrootways
Copy link

@MoMannn Got it, thank you. Do you know how can we skip duplicate entiry error while running delta migration second time?

@MoMannn
Copy link

MoMannn commented Jun 24, 2020

@Vishrootways To be honest I haven't dealt with magento in 3 years so I am completely out of it. Sry I can't be of more help.

@loginid
Copy link

loginid commented Jul 27, 2021

@victor-v-rad

Hello - this issue was reported 3 years ago.
Is it still the case?

Or is there a better way to run Delta on Development Database from non-prod DB?

Thank you.

@nadeem0035
Copy link

I have updated the script of @MoMannn to make it compatible with latest magento 2.4.4 version. I have added all tables and fix some bugs.

Use updated Script
https://github.com/nadeem0035/magento_delta_migration_script

@fallbeata
Copy link

Hi @MoMannn ! I need to put the script inside m1 or m2 server? Do I need to run something after that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests