Answers.Body: <p>Maybe you can try to run the upgrade script again to go from 4.7.10 to 4.7.12</p>
  
  <pre><code>http://&lt;your_wordpress_home&gt;/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/upgrade&amp;reset=1
  </code></pre>
  
  <p>Documented on the  Wiki <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Wordpress#UpgradingCiviCRMforWordPress-4.RuntheUpgradescript" rel="noreferrer">Upgrading CiviCRM for Wordpress</a> .</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-07T13:47:43.723Z
Answers.Text: Running the upgrade script resolved the issue. Thanks Kainuk.
Answers.UserDisplayName: Sudesh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-11T18:27:51.047Z
Answers.Text: Yes - I ran into the same problem when creating a clone of the site, accidentally using a pre-upgrade MySQL backup with the current version of the codebase.  Running the upgrade fixed the error.
Answers.UserDisplayName: Eliot Mason
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-03T09:20:43.027Z
Answers.LastActivityDate: 2016-11-03T09:20:43.027Z
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.Body: <p>As mentioned on another <a href="https://civicrm.stackexchange.com/questions/17725/migrate-wordpress-installation-to-new-server/18371#18371">ticket</a> this error can happen if you haven't run civicrm/upgrade</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-27T23:40:24.590Z
Answers.LastActivityDate: 2017-04-27T23:40:24.590Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>This wiki page <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location</a> explains how to move to a new server.</p>
  
  <p>You should use exactly the same version of civi on your old and new servers and then upgrade after you have completed all the steps in the above article.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-03T09:15:52.773Z
Answers.LastActivityDate: 2016-11-03T09:15:52.773Z
Answers.UserDisplayName: Aidan
Body: <p>We have moved our hosting to  new hosting provided (CiviHosting). CiviHosting installed a fresh installation of CiviCRM 4.7. We then imported our previous sql dump from our old site which also had been upgraded to 4.7. The import was done via c-panel. After the import, we get this error when running CiviCRM:</p>
  
  <p>CiviCRM_API3_Exception: "DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API. If so, please raise a bug report."</p>
  
  <pre><code>#0 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(125): civicrm_api3("DashboardContact", "get", (Array:5))
  #1 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(158): CRM_Core_BAO_Dashboard::getContactDashlets()
  #2 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(47): CRM_Core_BAO_Dashboard::getContactDashletsForJS()
  #3 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Contact_Page_DashBoard-&gt;run((Array:2), NULL)
  #4 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #5 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
  #6 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:2))
  #7 [internal function](): CiviCRM_For_WordPress-&gt;invoke("")
  #8 /home/iskcon/www/www/wp-includes/plugin.php(524): call_user_func_array((Array:2), (Array:1))
  #9 /home/iskcon/www/www/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
  #10 {main}
  </code></pre>
  
  <p>How do we go about importing our previous database to the new installation? I would appreciate a simplified explanation of the steps to resolve this.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-03T08:27:58.107Z
Comments.Text: Hi Sudesh, what is the exact version of CiviCRM? Maybe its there is a difference in the third part. Running the upgrade script can help.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-03T08:56:14.997Z
Comments.Text: Hi Kainuk. Here are the CiviCRM versions: The old site used: 4.7.10. The new site has: 4.7.12 installed.
Comments.UserDisplayName: Sudesh
Tags: <upgrade><import><database>
Title: CiviCRM 4.7 - DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API
ThreadText: # CiviCRM 4.7 - DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API
  
  (Asked by: username_0 on 2016-11-03)
  
  We have moved our hosting to  new hosting provided (CiviHosting). CiviHosting installed a fresh installation of CiviCRM 4.7. We then imported our previous sql dump from our old site which also had been upgraded to 4.7. The import was done via c-panel. After the import, we get this error when running CiviCRM:
  CiviCRM_API3_Exception: "DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API. If so, please raise a bug report."
  #0 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(125): civicrm_api3("DashboardContact", "get", (Array:5))
  #1 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Dashboard.php(158): CRM_Core_BAO_Dashboard::getContactDashlets()
  #2 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(47): CRM_Core_BAO_Dashboard::getContactDashletsForJS()
  #3 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Contact_Page_DashBoard->run((Array:2), NULL)
  #4 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #5 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:2))
  #6 /home/iskcon/www/www/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:2))
  #7 [internal function](): CiviCRM_For_WordPress->invoke("")
  #8 /home/iskcon/www/www/wp-includes/plugin.php(524): call_user_func_array((Array:2), (Array:1))
  #9 /home/iskcon/www/www/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
  #10 {main}
  
  How do we go about importing our previous database to the new installation? I would appreciate a simplified explanation of the steps to resolve this.
  
  **Tags:** upgrade, import, database
  
  > **Comments:**
  > **username_1**: Hi username_0, what is the exact version of CiviCRM? Maybe its there is a difference in the third part. Running the upgrade script can help.  
  > **username_0**: Hi Kainuk. Here are the CiviCRM versions: The old site used: 4.7.10. The new site has: 4.7.12 installed.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-11-03. Score: 7 | Accepted answer
  
  Maybe you can try to run the upgrade script again to go from 4.7.10 to 4.7.12
  http:///wp-admin/admin.php?page=CiviCRM&q=civicrm/upgrade&reset=1
  
  Documented on the  Wiki Upgrading CiviCRM for Wordpress .
  
  > **Comments:**
  > **username_0**: Running the upgrade script resolved the issue. Thanks Kainuk.  
  > **username_2**: Yes - I ran into the same problem when creating a clone of the site, accidentally using a pre-upgrade MySQL backup with the current version of the codebase.  Running the upgrade fixed the error.  
  
  ---
  
  ### Answer by username_3 on 2017-04-27. Score: 0
  
  As mentioned on another [ticket](https://civicrm.stackexchange.com/questions/17725/migrate-wordpress-installation-to-new-server/18371#18371) this error can happen if you haven't run civicrm/upgrade
  
  
  ---
  
  ### Answer by username_4 on 2016-11-03. Score: 0
  
  This wiki page <https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location> explains how to move to a new server.
  
  You should use exactly the same version of civi on your old and new servers and then upgrade after you have completed all the steps in the above article.
  
  
  ---
  
  