3

I am having crazy trouble moving my CiviCRM/Wordpress installation from one server to another.

I don't have many customizations, and we are a young organization, so I am OK with whatever solution gets my contacts and contributions to the new server, whether it's a complete copy or a fresh install and some sort of import. I think I would even be fine migrating to Drupal if it makes things easier (I have experience with Drupal sites as well), since that seems to be the most popular setup.

I have followed the instructions on the wiki, and read a few dozen other articles and threads, but everything I find relates to Drupal and the steps don't seem to line up to Wordpress...something always goes wrong.

I am able to get a new working copy of CiviCRM going but when I import my DB it breaks, and I get errors like this:

Sorry but we are not able to provide this at the moment. DB Constraint Violation - dashboard_id should possibly be marked as mandatory for DashboardContact,get API. If so, please raise a bug report.

I tried exporting using phpMyAdmin, including "disable foreign key constraint checks" and "Add drop table" and other combinations of options...nothing seems to work.

I'm not sure what I'm doing wrong, and would appreciate a little hand.

Some details: - My current install is at 4.7.7 - CiviCRM shares a database with Wordpress

6
  • Please give more details about how you're importing your records? Also, you mention getting a "new working copy" of CiviCRM - this isn't typical. Generally you'd create a blank database in MySQL and load in your old database dump. Commented Mar 16, 2017 at 5:17
  • I actually export a .sql file using phpMyAdmin, then import it into the new database. The instructions in the wiki article above offer two routes: install a fresh copy of CiviCRM and importing your data, or export/import everything altogether. I've tried both ways with little luck. I can move my Wordpress website over no problem, and can install CiviCRM there. But importing my data breaks it. If I try the other route, I can access my site but not CiviCRM — I end up with blank screens. Commented Mar 16, 2017 at 19:25
  • Did you give the new database the same name as the old? Did you update CiviCRM.settings.php to reference the new database name and password? In the past what I've done is moved the Wordpress install and database, then installed CiviCRM and referenced the new database. However, you do need to update the existing CiviCRM database files with the correct mySQL and server information. Commented Mar 16, 2017 at 21:37
  • The database did not have the same name — but I did update CiviCRM.settings.php to reference the new db. Does it have to have the same name? Also, I had been importing the old database into the new installation -- but I will try your suggestion of using a second database and just changing the CiviCRM.settings.php credentials. When you say "update the existing CiviCRM database files" do you refer to CiviCRM.settings.php or other files that need updating? Commented Mar 17, 2017 at 3:02
  • I know it's been a while, but still no luck here. I was able to import my DB without any errors, but when I update the CiviCRM.settings.php file with the new DB info, I lose access to the CiviCRM dashboard and pages. Are there other locations I need to populate the new DB information? Commented Apr 30, 2017 at 8:42

2 Answers 2

1

The instructions here how to back up databases using phpMyAdmin used to work for me. The author wrote:

“Disable foreign key checks” isn’t always necessary. I do a lot of CiviCRM work. Restoring a CiviCRM database will fail unless this option is enabled in your export.

1
  • The link you provided seemed to help — I was able to import my database without any errors. I still cannot get the core files to connect with the db. Commented Apr 30, 2017 at 8:44
0

In one instance when I hit this, it was a site that had been copied over but not fully configure and then ignored for a while, during which time the live site had an upgrade, and hence the code had changed. To bring it back to life I then did a git pull.

I then started getting the above error. And finally clicked that I needed to run civicrm/upgrade.

Just posting in case it helps others some head scratching.

Have asked one of our team if we can get the error message modified to include the 'check if you need to run a database update' in case the helps too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.