Answers.Body: <p>This would appear to be an issue that should be cleaned up prior to the upgrade. I have logged this issue in the JIRA issue queue here <a href="https://issues.civicrm.org/jira/browse/CRM-18485" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-18485</a> and I have a proposed solution of essentially purging the database of the activity_tab_filter settings before upgrade. My proposed solution is here <a href="https://github.com/civicrm/civicrm-core/pull/8273" rel="nofollow">https://github.com/civicrm/civicrm-core/pull/8273</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-03T14:59:34.093Z
Answers.Text: This solution worked best for me, to delete `activity_tab_filter` entries from `civicrm_setting`.
Answers.UserDisplayName: choster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-02T04:40:17.260Z
Answers.LastActivityDate: 2016-05-02T04:40:17.260Z
Answers.UserDisplayName: Seamus Lee
Answers.Body: <p>Similar problem here. How do we fix this problem? I don't understand how to do this: "You will need to list your settings as stored in the database..."</p>
  
  <p><a href="https://i.sstatic.net/CFkpT.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CFkpT.jpg" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-07T13:41:24.473Z
Answers.Text: That screenshot is exactly what happened to me. I haven't tried again since now I'm getting another error http://civicrm.stackexchange.com/questions/9456/message-fatal-db-error-exiting-seems-like-your-schema-does-not-have-civicrm
Answers.UserDisplayName: Esther
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-16T07:07:22.080Z
Answers.Text: The only way I could resolve the error was to remove the offending contact entry. Not the ideal solution and only workable since it was a single entry with little supporting data attached. I could not find any duplicate entry or duplicate content within the entry that would have cause the offense.
Answers.UserDisplayName: Iantha Scheiwe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-16T07:07:58.740Z
Answers.Text: It looks like the contact that is causing you trouble is CID33890.
Answers.UserDisplayName: Iantha Scheiwe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-06T19:22:48.150Z
Answers.LastActivityDate: 2016-02-06T19:22:48.150Z
Answers.UserDisplayName: pixelshark
Answers.Body: <p>Initially deleted what appeared to be duplicate activity entries from user #571, but that did not fix the problem. Restored to the backup version and then this problem was finally resolved by deleting user 571 (my own entry) from the DB.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-03T00:44:37.123Z
Answers.LastActivityDate: 2016-02-03T00:44:37.123Z
Answers.UserDisplayName: Iantha Scheiwe
Answers.Body: <p>It seems that you have the same setting that is set twice on your database, and the upgrade to 4.7 enforce it won't happen.</p>
  
  <p>You will need to list your settings as stored in the database, you should see more than one activity_tab_filter for the contact_id 571.</p>
  
  <p>Delete the duplicate(s) and keep only one and then run the upgrade again and you should be fine</p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-02T10:53:06.547Z
Answers.Text: I experienced a similar problem to Iantha. Unfortunately, the upgrade won't run again with the error, "Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again." I tried restoring a backup of the database, but that hasn't worked either.
Answers.UserDisplayName: Esther
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-02T13:54:58.487Z
Answers.Text: I got my database restored to a backup, deleted the duplicates (or so I thought) and still got the same error. In deleting the duplicates, I noticed that they were all of my own name - well over 5,000 entries. The duplicate entries are no doubt elated to this problem I was having - http://civicrm.stackexchange.com/questions/6883/new-contact-created-every-time-i-login . I'm now going to go back to 4.6, hopefully that will still work!
Answers.UserDisplayName: Esther
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-03T00:42:01.147Z
Answers.Text: Thanks Penny and Xavier. I did get this fixed. I am not quite sure about the error, though. It was my own contact entry causing the problem. No problem to delete myself. But, there is no duplicate for me. I went through and cleaned up test activities that were in my record, but that did not solve the problem. In the end, I went ahead and permanently deleted myself and everything upgraded fine. But, I'm feeling a little strange about what was the real source of the error in the record.
Answers.UserDisplayName: Iantha Scheiwe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-03T13:12:32.717Z
Answers.Text: @Penny It sounds like you restored a backup of the database without dropping and recreating the MySQL database.  CiviCRM 4.7 adds new tables to the database; restoring a backup won't overwrite tables that weren't in the backup.  So you must drop/recreate the database before restoring in order to fix a "partially upgraded" error.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-07T06:59:53.837Z
Answers.Text: @IanthaScheiwe Yup - that's exactly what I ended up doing to resolve the problem.
Answers.UserDisplayName: Esther
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-02T08:09:40.423Z
Answers.LastActivityDate: 2016-02-02T08:09:40.423Z
Answers.UserDisplayName: Xavier
Body: <p>I receive the error below during the upgrade process. I restored to previous backup and tried again and received the same. Any ideas what exactly is it indicating is duplicate? Thanks so much!</p>
  
  <blockquote>
    <p>[Error: Migrate Settings to 4.7.alpha1] Error Field   Error Value
    Type  DB_Error Code   -5 Message  DB Error: already exists Mode   16
    UserInfo  ALTER TABLE civicrm_setting ADD UNIQUE INDEX
    index_domain_contact_name (domain_id, contact_id, name)
    [nativecode=1062 ** Duplicate entry '1-571-activity_tab_filter' for
    key 'index_domain_contact_name'] DebugInfo    ALTER TABLE civicrm_setting
    ADD UNIQUE INDEX index_domain_contact_name (domain_id, contact_id,
    name) [nativecode=1062 ** Duplicate entry '1-571-activity_tab_filter'
    for key 'index_domain_contact_name']</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-02T07:35:00.290Z
Comments.Text: I'm running the db tools package to see if that will help me identify the source of this problem. Will update if I receive an answer from that.
Comments.UserDisplayName: Iantha Scheiwe
Tags: <upgrade><error>
Title: DB Error on upgrade to 4.7: Duplicate entry activity_tab_filter for key 'index_domain_contact_name'
ThreadText: # DB Error on upgrade to 4.7: Duplicate entry activity_tab_filter for key 'index_domain_contact_name'
  
  (Asked by: username_0 on 2016-02-02)
  
  I receive the error below during the upgrade process. I restored to previous backup and tried again and received the same. Any ideas what exactly is it indicating is duplicate? Thanks so much!
  
  > [Error: Migrate Settings to 4.7.alpha1] Error Field Error Value
  > Type DB\_Error Code -5 Message DB Error: already exists Mode 16
  > UserInfo ALTER TABLE civicrm\_setting ADD UNIQUE INDEX
  > index\_domain\_contact\_name (domain\_id, contact\_id, name)
  > [nativecode=1062 \*\* Duplicate entry '1-571-activity\_tab\_filter' for
  > key 'index\_domain\_contact\_name'] DebugInfo ALTER TABLE civicrm\_setting
  > ADD UNIQUE INDEX index\_domain\_contact\_name (domain\_id, contact\_id,
  > name) [nativecode=1062 \*\* Duplicate entry '1-571-activity\_tab\_filter'
  > for key 'index\_domain\_contact\_name']
  
  **Tags:** upgrade, error
  
  > **Comments:**
  > **username_0**: I'm running the db tools package to see if that will help me identify the source of this problem. Will update if I receive an answer from that.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_5 on 2016-02-02. Score: 4 | Accepted answer
  
  It seems that you have the same setting that is set twice on your database, and the upgrade to 4.7 enforce it won't happen.
  
  You will need to list your settings as stored in the database, you should see more than one activity\_tab\_filter for the contact\_id 571.
  
  Delete the duplicate(s) and keep only one and then run the upgrade again and you should be fine
  
  X+
  
  > **Comments:**
  > **username_4**: I experienced a similar problem to Iantha. Unfortunately, the upgrade won't run again with the error, "Database check failed - the database looks to have been partially upgraded. You may want to reload the database with the backup and try the upgrade process again." I tried restoring a backup of the database, but that hasn't worked either.  
  > **username_4**: I got my database restored to a backup, deleted the duplicates (or so I thought) and still got the same error. In deleting the duplicates, I noticed that they were all of my own name - well over 5,000 entries. The duplicate entries are no doubt elated to this problem I was having - http://civicrm.stackexchange.com/questions/6883/new-contact-created-every-time-i-login . I'm now going to go back to 4.6, hopefully that will still work!  
  > **username_0**: Thanks Penny and username_5. I did get this fixed. I am not quite sure about the error, though. It was my own contact entry causing the problem. No problem to delete myself. But, there is no duplicate for me. I went through and cleaned up test activities that were in my record, but that did not solve the problem. In the end, I went ahead and permanently deleted myself and everything upgraded fine. But, I'm feeling a little strange about what was the real source of the error in the record.  
  > **username_6**: @Penny It sounds like you restored a backup of the database without dropping and recreating the MySQL database.  CiviCRM 4.7 adds new tables to the database; restoring a backup won't overwrite tables that weren't in the backup.  So you must drop/recreate the database before restoring in order to fix a "partially upgraded" error.  
  > **username_4**: @IanthaScheiwe Yup - that's exactly what I ended up doing to resolve the problem.  
  
  ---
  
  ### Answer by username_1 on 2016-05-02. Score: 3
  
  This would appear to be an issue that should be cleaned up prior to the upgrade. I have logged this issue in the JIRA issue queue here <https://issues.civicrm.org/jira/browse/CRM-18485> and I have a proposed solution of essentially purging the database of the activity\_tab\_filter settings before upgrade. My proposed solution is here <https://github.com/civicrm/civicrm-core/pull/8273>
  
  > **Comments:**
  > **username_2**: This solution worked best for me, to delete `activity_tab_filter` entries from `civicrm_setting`.  
  
  ---
  
  ### Answer by username_3 on 2016-02-06. Score: 1
  
  Similar problem here. How do we fix this problem? I don't understand how to do this: "You will need to list your settings as stored in the database..."
  
  [![enter image description here](https://i.sstatic.net/CFkpT.jpg)](https://i.sstatic.net/CFkpT.jpg)
  
  > **Comments:**
  > **username_4**: That screenshot is exactly what happened to me. I haven't tried again since now I'm getting another error http://civicrm.stackexchange.com/questions/9456/message-fatal-db-error-exiting-seems-like-your-schema-does-not-have-civicrm  
  > **username_0**: The only way I could resolve the error was to remove the offending contact entry. Not the ideal solution and only workable since it was a single entry with little supporting data attached. I could not find any duplicate entry or duplicate content within the entry that would have cause the offense.  
  > **username_0**: It looks like the contact that is causing you trouble is CID33890.  
  
  ---
  
  ### Answer by username_0 on 2016-02-03. Score: 1
  
  Initially deleted what appeared to be duplicate activity entries from user #571, but that did not fix the problem. Restored to the backup version and then this problem was finally resolved by deleting user 571 (my own entry) from the DB.
  
  
  ---
  
  