# Error during migration from 2.8.1 to 2.9

**URL:** https://forum.mautic.org/t/error-during-migration-from-2-8-1-to-2-9/9069
**Category:** Product Support
**Created:** [July 26, 2017, 12:57pm UTC](https://forum.mautic.org/t/error-during-migration-from-2-8-1-to-2-9/9069 "2017-07-26T12:57:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jtibrewala](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jtibrewala](https://forum.mautic.org/u/jtibrewala)
#### Post date: [July 26, 2017, 12:57pm UTC](https://forum.mautic.org/t/error-during-migration-from-2-8-1-to-2-9/9069/1 "2017-07-26T12:57:07Z")

</div>

Hi all, I have mautic 2.8.1 installed on AWS. I got a notification in the app to upgrade to 2.9. Went through the process and database migration failed.  
  
I followed the steps at [https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful](https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful) and got to this error message:  
  
  
  
Migration 20160926182807 failed during Execution. Error An exception occurred while executing ‘insert into mau\_companies\_leads (company\_id, lead\_id, date\_added, manually\_added, manually\_removed) SELECT c.id, l.id, ‘2017-06-09 09:16:09’, 0, 0 from mau\_leads l join mau\_companies c on c.companyname = l.company ON DUPLICATE KEY UPDATE company\_id = c.id;’:  
  
  
  
SQLSTATE[HY000]: General error: 1364 Field ‘is\_primary’ doesn’t have a default value  
  
  
  
How do I resolve this issue? Stupid me didn’t even keep a backup of the database before migration. Would really appreciate your help in resolving this.

---

<div class="post-metadata">

### Author: ![jtibrewala](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jtibrewala](https://forum.mautic.org/u/jtibrewala)
#### Post date: [July 26, 2017, 12:57pm UTC](https://forum.mautic.org/t/error-during-migration-from-2-8-1-to-2-9/9069/2 "2017-07-26T12:57:07Z")

</div>

Hi all, I have mautic 2.8.1 installed on AWS. I got a notification in the app to upgrade to 2.9. Went through the process and database migration failed.  
I followed the steps at [https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful](https://johnlinhart.com/blog/uh-oh-mautic-upgrade-was-not-successful) and got to this error message:

Migration 20160926182807 failed during Execution. Error An exception occurred while executing ‘insert into mau\_companies\_leads (company\_id, lead\_id, date\_added, manually\_added, manually\_removed) SELECT c.id, l.id, ‘2017-06-09 09:16:09’, 0, 0 from mau\_leads l join mau\_companies c on c.companyname = l.company ON DUPLICATE KEY UPDATE company\_id = c.id;’:

SQLSTATE[HY000]: General error: 1364 Field ‘is\_primary’ doesn’t have a default value

How do I resolve this issue? Stupid me didn’t even keep a backup of the database before migration. Would really appreciate your help in resolving this.

---

<div class="post-metadata">

### Author: ![jtibrewala](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jtibrewala](https://forum.mautic.org/u/jtibrewala)
#### Post date: [July 26, 2017, 12:59pm UTC](https://forum.mautic.org/t/error-during-migration-from-2-8-1-to-2-9/9069/3 "2017-07-26T12:59:24Z")

</div>

I see that this issue is identical to [https://github.com/mautic/mautic/issues/4208](https://github.com/mautic/mautic/issues/4208) Do I need to login to the database directly to fix this problem, or can anyone guide me for this fix through the command line?
