When running 'CommerceMigrateUbercartProductType' I was getting this error: Integrity constraint violation: 1062 Duplicate entry 'product' for key 'PRIMARY': INSERT INTO {commerce_product_type}
even though I had deleted the product content type created by the Commerce Kickstart installation. I looked in the database and found that there was still an entry in the commerce_product_type table. I deleted that and then 'CommerceMigrateUbercartProductType' worked.

CommentFileSizeAuthor
#12 1408552.delete_existing_product_type.patch797 byteshaza

Comments

rfay’s picture

Status: Active » Fixed

OK thanks for reporting it. Sounds like somehow the product type deletion process failed.

Anonymous’s picture

In the process of developing this site, I went through the Ubercart migrate process several times while trying to solve various errors and learn the system. I only ran into this issue when I tried to migrate directly from an Ubercard D6 database to D7 Commerce Kickstart. When I first converted the Ubercart D6 install to Ubercart D7, then performed the Migrate, everything went smoothly.

rfay’s picture

Interesting, because it's had a lot more time (and is more carefully tuned for) the Ubercart D6 -> Commerce scenario.

Anonymous’s picture

Perhaps it's just something to be aware of going forward. I'll be working with the Ubercart Migrate stuff a lot I imagine, so I'll let you know if I run into the problem again. Thanks for your help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rfay’s picture

Project: Commerce Migrate » Commerce Migrate Ubercart
Component: Commerce Migrate Ubercart » Code
luksak’s picture

Status: Closed (fixed) » Active

I had this issue when migrating from Ubercart D7.

rfay’s picture

Status: Active » Fixed

You *have to* delete the "product" product type (automatically created by Commerce) before beginning. That's on the instructions on the project page and in the README.

And it's admittedly ugly.

luksak’s picture

Yeah, I know. I just thought that according to this issue it should be fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

alexp999’s picture

Status: Closed (fixed) » Active

I'm still having this issue.

There doesn't seem to be anyway of deleting the "product" product type.

I tried removing it manually from the database, but then the whole site errors out and I had to restore from backup.

haza’s picture

Status: Active » Needs review
StatusFileSize
new797 bytes

Here is a small patch that will delete a product type, if it exists, that have the same name that the one you try to migrate.

I'm not sure if we really need that or not.

alexp999’s picture

Just to say that the above patch worked perfectly.

Thanks!

liliplanet’s picture

patch in #12 is fabulous, thank you!

jantoine’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #12 is simple and straightforward and it works!

mrconnerton’s picture

Version: 7.x-1.x-dev » 7.x-2.0-alpha4
Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Seems like this issue doesn't apply any more since the latest 2.x version requires you to create the product types manually before you run your migrations.

shaneonabike’s picture

Status: Postponed (maintainer needs more info) » Active

So sorry my last post is completely irrelevant to this ticket I apologize.

shaneonabike’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev

Just changing the version that this applies to.