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 »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • drupal mysqldump to civicrm standalone
Pages: [1]

Author Topic: drupal mysqldump to civicrm standalone  (Read 1368 times)

salmobytes

  • Guest
drupal mysqldump to civicrm standalone
August 14, 2009, 03:16:13 pm
I have an empty/default values  civicrm standalone configured and installed (and can delete and reinstall as needed).
I also have a mysqldump from a Drupal/Civicrm site that no longer exists.

I want to import the data from the now defunct Drupal installation.
If I do the following:

mysql -u adminame -p'password' civicrm < mysqldump.sql 
....dies (as expected) with a Table 'civicrm_acl' already exists

loading the dump file first prevents the installation from working.

I tried to strip the CREATE TABLE portions from the dump file,
so it consisted of INSERTS only, but that lead to chaos as well.

How do I do this? (install an empty standalone, and then load data from an external Drupal/Civicrm schema)

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: drupal mysqldump to civicrm standalone
August 14, 2009, 06:19:13 pm

1. ensure that your mysqldump is of the complete extended format (mysqldump -c -e -t -n)

2. load civicrm.mysql

3. load the mysqldump from step 1

4. truncate civicrm_uf_match, civicrm_cache, civicrm_acl_cache, civicrm_menu

5. update civicrm_domain set config_backend = null;

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

salmobytes

  • Guest
Re: drupal mysqldump to civicrm standalone
August 15, 2009, 06:04:10 am
Thank you.
That's a start

1. ensure that your mysqldump is of the complete extended format (mysqldump -c -e -t -n)
      .....I have a dump from a site whose disk space has been deleted.
      Not sure how to debug the status of the dump I have.
      It's possible (probable) the person who made the dump simply said something like:
         mysqldump -uadmin -p'password' civicrm > civicrm.dump_date   ...without the flags -c -e -t -n

      I could (laboriously) study the schema and then write a perl (or perhaps php) script, complete with
      insert subroutines for selected tables that capture and return primary keys upon insert,
      and then insert various data in the right sequential order, so all foreign keys get the right value, etc.
      But that would take days. The ability to round-trip from standalone to a drupal plugin
      and/or the other direction (my case) would be a handy utility.

2. load civicrm.mysql
    OK, I dropped the database and recreated it, then loaded civicrm.mysql

3. load the mysqldump from step 1
    Now I try to load the dump, but that dies with "civicrm_acl already exists"
    ....that table gets created by loading civicrm.mysql

4. truncate civicrm_uf_match, civicrm_cache,civicrm_cache, civicrm_acl_cache, civicrm_menu
    By this do you mean:
       delete from civicrm_uf_match, delete from civicrm_cache, etc?

5. update civicrm_domain set config_backend = null;
     This update is straightforward, but I never get this far due to dying at step 3

« Last Edit: August 15, 2009, 06:25:28 am by salmobytes »

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: drupal mysqldump to civicrm standalone
August 15, 2009, 06:24:27 am

for step 1, how about loading the mysqldump into a new clean empty database and then redumping it with the options i suggested

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • drupal mysqldump to civicrm standalone

This forum was archived on 2017-11-26.