CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Separating Drupal and CiviCRM databases
Pages: [1]

Author Topic: Separating Drupal and CiviCRM databases  (Read 2460 times)

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Separating Drupal and CiviCRM databases
August 14, 2007, 02:28:36 pm
We've inherited a recent Drupal 5 CiviCRM 1.7 website installed in a single MySQL 5 database and I'm looking for guidance on the possibility of backing up and restoring it to separate Drupal and CiviCRM databases before upgrading to CiviCRM 1.8. Has anyone tried this?

Neil

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Separating Drupal and CiviCRM databases
August 14, 2007, 11:39:50 pm
I haven’t done it on a production server, but I think I once or twice did create a CiviCRM database from a common Drupal+CiviCRM one.

Basically, you should dump the database to a file, copy it to a second file, and then leave all the civicrm_* tables related content in one while removing it from the other. You can then import the two files as your new CiviCRM and Drupal databases.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: Separating Drupal and CiviCRM databases
August 15, 2007, 06:33:46 pm
Thanks Piotr!

That worked fine, no problems.

Neil

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Separating Drupal and CiviCRM databases
August 18, 2007, 06:35:00 am
Could I get some guidance on this?  I recently tried to do this dump and restore cycle in order to change servers, but I always get errors and it fails.  It complains about the "DEFAULT CHARSET=utf8" part of the commands.  So I edited the sql file to remove those phrases, but it failed again on some other part of the sql.  Is there a recipe somewhere for how to backup and restore?  Any suggestions welcome.


Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Separating Drupal and CiviCRM databases
August 18, 2007, 06:39:14 am
Which MySQL version are you using? The only MySQL that should have problems with UTF-8 is MySQL 4.0…
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: Separating Drupal and CiviCRM databases
August 19, 2007, 09:04:15 pm
While my test went perfectly, when I ran the same procedure on the production site it wouldn't use the new Drupal db. The new CiviCRM db is fine. So I just left the appropriate settings pointed to the original db. Now I'd like to clean up and drop the civicrm tables which are not being used in the Drupal db. Somehow, I wasn't surprised when I got the following when I tried to drop civicrm_acl

ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails

Is there a particular order I should drop them? All at once? or can I tell it to ignore foreign key constraints somehow?

BTW upgraded test to 1.8 (with split db) flawlessly. Hope production is as smooth  8)

Neil

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Separating Drupal and CiviCRM databases
August 19, 2007, 09:24:01 pm

Neil:

check sql/civicrm_41.mysql

the order of the drop statements at the top is FK sensitive and should avoid any FK errors.

You can also tell mysql to ignore FK constraints by:

SET FOREIGN_KEY_CHECKS=0;

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: Separating Drupal and CiviCRM databases
August 20, 2007, 08:05:13 pm
Thanks, I'll give it a try.
The 1.8 upgrade went great! CiviCRM 1.8 is really sweet!
After 8 months with a couple of hundred newbie users on http://www.greenparty.ca
I was especially pleased to find "Site Preferences" under "Global Settings"  :)

Lots of other goodies too.

http://www.voteformmp.ca is almost ready for prime time.
Server's waiting for more RAM and disk, and still some forms etc. to finish up and CiviMail, CiviEvent ...

Neil

twowheeler

  • I post occasionally
  • **
  • Posts: 115
  • Karma: 11
    • Harrisburg Christian Performing Arts Center
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Separating Drupal and CiviCRM databases
August 21, 2007, 03:18:49 pm
Quote from: Piotr Szotkowski on August 18, 2007, 06:39:14 am
Which MySQL version are you using? The only MySQL that should have problems with UTF-8 is MySQL 4.0…

That was it.  Fixed now and running great.  I love 1.8.  Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Separating Drupal and CiviCRM databases

This forum was archived on 2017-11-26.