---
title: "How to fix “Unique constraint violation found” in Magento 2 Checkout Page After Migration"
url: "https://magecomp.com/blog/fix-unique-constraint-violation-found-magento-2-checkout-after-migration/"
date: "2017-12-07T16:09:06+00:00"
modified: "2025-02-21T13:01:59+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 295
reading_time: "2 min read"
summary: "Magento 2 uses new approaches with new and enhanced design, and database that gives store owners to enhance their shopping experiences, increase security &amp; functionality compared to Magento 1. ..."
description: "Facing the issue of "Unique constraint violation found " after migrating your existing Magento 1.x stores to Magento 2? Read this step by step guide to fix i..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Secure your Magento 2.x Store"
    url: "https://magecomp.com/blog/secure-magento-2-x-store/"
  - title: "Magento 2: How to Create a Password or an Encrypted Field in System Configuration"
    url: "https://magecomp.com/blog/magento-2-create-a-password-or-an-encrypted-field-in-system-configuration/"
  - title: "In Magento 2: How to Customize Maintenance Default Page when Maintenance Mode is Active?"
    url: "https://magecomp.com/blog/customize-maintenance-default-page-magento-2/"
---

# How to fix “Unique constraint violation found” in Magento 2 Checkout Page After Migration

_Published: December 7, 2017_  
_Author: Dhiren Vasoya_  

![img How to fix Unique constraint violation found at Checkout page in Magento2 after migration](https://magecomp.com/blog/wp-content/uploads/2017/12/img_How-to-fix-Unique-constraint-violation-found-at-Checkout-page-in-Magento2-after-migration-1024x332.webp)

Magento 2 uses new approaches with new and enhanced design, and database that gives store owners to enhance their shopping experiences, increase security & functionality compared to Magento 1. Out of the box, Magento 2 comes with new user interface along with the capability of handling a large amount of data. To take advantage of these features and capabilities, Magento Store owners are migrating their existing store to feature pack Magento2 at a rate of knots. Migrating existing Magento store without losing data is one of the trickiest and the complex processes that need an attention and care to smoothly migrate your store. Recently, while upgrading a client’s web store, we faced an ***issue of “Unique constraint violation found” at product checkout in Magento 2*** as shown below.

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-1.webp)](https://magecomp.com/services/hire-magento-programmer/)

![Constraint](https://magecomp.com/blog/wp-content/uploads/2017/12/Constraint.png)

After mining the reason behind this issue, we found that to fix this issue, we have to manually add some entries to the database. We need to add ‘meta_id’ manually in ‘sales_sequence_profile’ table which defines in ‘sales_sequence_meta’ of a database as described below.
First of all, we need to add ‘**meta id**’ to ‘**sales_sequence_meta**’ table.

![add ‘meta id’ to ‘sales_sequence_meta’ table](https://magecomp.com/blog/wp-content/uploads/2017/12/Screenshot_1.png)

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

After adding ‘**meta id**’ to ‘**sales_sequence_meta**’ table, you need to add those ‘**meta id**’ to ‘**profile id**’ into existing ‘**sales_sequence_profile**’ table and additionally, we have to add more entry in ‘**prefix**’ column.

![add ‘meta id’ to ‘profile id’ into existing ‘sales_sequence_profile’ table ](https://magecomp.com/blog/wp-content/uploads/2017/12/Screenshot_2.png)

Once you are done, now you are unstoppable. Just clear the cache and your issue of “Unique Constraint Violation Found” is resolved.

Generally, we have noticed that the issue occurs while migrating a Magento store to 2.1.0 or later versions. Let me know with which Magento 2 version you are trying this code and also let me know in the comment section, if you are facing any issue while implementing this method.

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-5.webp)](https://magecomp.com/magento-malware-removal.html)
Happy Fixing!


---

_View the original post at: [https://magecomp.com/blog/fix-unique-constraint-violation-found-magento-2-checkout-after-migration/](https://magecomp.com/blog/fix-unique-constraint-violation-found-magento-2-checkout-after-migration/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-08 13:00:10 UTC_  
