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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Changing Contact Type
Pages: [1]

Author Topic: Changing Contact Type  (Read 2052 times)

Digital

  • Guest
Changing Contact Type
January 30, 2008, 02:38:19 am
What is the appropriate method to convert a individual to a household? I know it can be done (unintentionally) through custom forms, but I haven't found a place to do it legit.

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Changing Contact Type
January 30, 2008, 03:50:23 am
You can write the query

UPDATE `civicrm_contact` SET `contact_type` = "Household" WHERE `id`=102

HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Changing Contact Type
January 30, 2008, 03:45:34 pm
Please note that running these SQL queries is not really a "legit" way to do this - and can cause data integrity issues if you don't do it correctly. There is no wy to change contact type within the user interface - so if you're dealing with one or a few contacts - I would just delete the Individual contact(s) and create the Household(s).

If this is not an option and you want to use SQL - AND assuming you are working with version 1.9 or earlier - you will need to run two additional queries on top of the one posted by Yashoda below. (All query examples use 102 as the contact ID - you'll need to find that value for the records you are modifying.)

DELETE from `civicrm_individual` WHERE `contact_id` = 102;
INSERT into `civicrm_household`(contact_id, household_name) VALUES (102, 'The Household Name Here');
Protect your investment in CiviCRM by  becoming a Member!

anniekin

  • Guest
Re: Changing Contact Type
April 22, 2008, 12:09:45 pm
In Dave's reply, I notice he said "if working with CiviCRM 1.9 or earlier." Has anything changed with regard to changing contact types in 2.0?

-Is there still no way to change contact type within the user interface?
-If not, is there any semi-legit process out there?

I'm guessing no, but I thought I'd ask to see what, if anything has changed to make this easier in 2.0?

What I'm looking to do -- I would like to convert some individuals to organizations. I know how to do it manually in the user interface and that that would probably be cleaner and easier for me than trying to convert all the data via SQL, but I have a bunch of contacts, so neither options sounds great.

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: Changing Contact Type
April 22, 2008, 12:32:47 pm

In 2.0 this is a bit easier since there is no separate indiv/household/org table. they are all in the same table. There is no user interface to change this as yet.

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Changing Contact Type
April 29, 2008, 06:54:42 am
I did the sql dirty change on about 100 contacts about a month ago, and so far I haven't seen any problem indeed (on a 2.0)

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Changing Contact Type

This forum was archived on 2017-11-26.