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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • how can you save custom fields for abother database?
Pages: [1]

Author Topic: how can you save custom fields for abother database?  (Read 1118 times)

webguy2

  • Guest
how can you save custom fields for abother database?
August 20, 2009, 05:49:26 am
I have to start over with a new database but have lots of custom fields I need to preserve.

How can I do that?  Can I export them to sql file?  Can I export certain tables that would carry the custom field info?

Thanks!

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: how can you save custom fields for abother database?
August 21, 2009, 12:11:18 am
If its just the custom groups and fields (but not the values stored for entity like contact, contribution .etc), you 'll need -
1. data dump of civicrm_custom_group and civicrm_custom_field tables.
2. structure dump for all the tables which are result of this query - "SELECT `table_name`FROM `civicrm_custom_group`;"

In #1 data dump make sure its the civicrm_custom_group table info that appears before civicrm_field, otherwise you 'll receive foreign key errors (unless you disable them during import).
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

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: how can you save custom fields for abother database?
August 21, 2009, 05:05:55 am

there are also two scripts packaged in the distribution:

bin/migrate/export.php
bin/migrate/import.php

which can help you move custom group/fields, profile groups/fields across databases.

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

webguy2

  • Guest
Re: how can you save custom fields for abother database?
August 21, 2009, 07:03:35 am
lobo - I've seen the files and read the PHP scripts.  How does that help in moving custom fields and groups across dbs?
« Last Edit: August 21, 2009, 07:08:49 am by webguy2 »

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: how can you save custom fields for abother database?
August 21, 2009, 08:31:13 am

export.php exports the custom group/fields etc as an xml file.

take that xml file and place it on the new server

import.php imports that xml file and loads it on the new server

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

webguy2

  • Guest
Re: how can you save custom fields for abother database?
August 21, 2009, 08:41:16 am
wow, I missed that boat completely.

Many thanks!!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • how can you save custom fields for abother database?

This forum was archived on 2017-11-26.