I am currently migrating some data from x-cart to light commerce for my company.
Because Product Options, Extra Fields and Related Products are stored in different tables and different structures I had to create a custom script to migrate the data.
The related data uses a dual row primary key, so if you have the following two rows:
pid1 pid2 order
124 162 0
162 124 0
you would get a duplicate index error, so instead I used INSERT IGNORE to just bypass the duplicate key error to move to the next record, since only like 40 records it seemed had this problem.