Answers.Body: <p>I would take a different approach to what your trying to do. If you want to extract data from CiviCRM you probably want to use something like the Data Processor extension and CSV out everything you need. Its very rare that you would try and built the entire extract from the database directly as you're probably going to have different destinations etc so would be much easier to use a tool to get what you need rather than trying to learn the ERD just for extraction.</p>
  <p>We often write queries against the CiviCRM database but thats much more for data insights or data denormalisation. Its not our approach for extracting data.</p>
  <p>Just my thoughts!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-16T14:40:10.073Z
Answers.Text: Great, thank you. This is the kind of info I'm looking for!
Answers.UserDisplayName: aaronbauman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-16T13:46:30.710Z
Answers.LastActivityDate: 2022-03-16T13:46:30.710Z
Answers.UserDisplayName: Parvez Saleh
Answers.Body: <p>I don't think there is a real ERD or Object documentation. There is <a href="https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html" rel="nofollow noreferrer">https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html</a> but by itself doesn't tell you what is what.</p>
  <p>You might want to use the built-in export feature to get a feel for the various entities: Search - Find XXX - then from the actions dropdown on the results page choose Export.</p>
  <p>The main table is civicrm_contact. Almost everything is connected to it in some way.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-15T23:16:27.240Z
Answers.Text: what is it about the ER diagram at for example https://doc.symbiotic.coop/dev/civicrm/latest/schema/tables/civicrm_email.html that means it is not a 'real ERD'? (keen to understand)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-15T23:29:45.157Z
Answers.Text: It show foreign keys which helps, but it's reverse engineered from the db, not starting from how objects are related. Something with "logical" vs "physical" groupings would be helpful. e.g. civicrm_domain seems useful in that diagram but how is it really related. What is civicrm_wordreplacements logically related to?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-16T13:44:14.537Z
Answers.Text: My understanding here is an ERD is just that, its not Logical otherwise it wouldn't be an ERD. We use Navicat or MySQL workbench to reverse engineer ERDs all the time and they are real as they represent the database as it stands.
Answers.UserDisplayName: Parvez Saleh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-15T22:36:29.817Z
Answers.LastActivityDate: 2022-03-15T22:36:29.817Z
Answers.UserDisplayName: Demerit
Body: <p>I'm a Drupal engineer with plenty of migration experience, but I have never migrated data out of Civi. Before I start trying to reverse engineer the database from source, maybe someone can give me some pointers or provide an overview of where to start?</p>
  <p>Which are the important tables?</p>
  <p>Is there some mapping from ERD to database tables?</p>
  
Tags: <migration>
Title: Migration from CiviCRM (Drupal 7) to Salesforce
ThreadText: # Migration from CiviCRM (Drupal 7) to Salesforce
  
  (Asked by: username_0 on 2022-03-15)
  
  I'm a Drupal engineer with plenty of migration experience, but I have never migrated data out of Civi. Before I start trying to reverse engineer the database from source, maybe someone can give me some pointers or provide an overview of where to start?
  
  Which are the important tables?
  
  Is there some mapping from ERD to database tables?
  
  **Tags:** migration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-03-16. Score: 3
  
  I would take a different approach to what your trying to do. If you want to extract data from CiviCRM you probably want to use something like the Data Processor extension and CSV out everything you need. Its very rare that you would try and built the entire extract from the database directly as you're probably going to have different destinations etc so would be much easier to use a tool to get what you need rather than trying to learn the ERD just for extraction.
  
  We often write queries against the CiviCRM database but thats much more for data insights or data denormalisation. Its not our approach for extracting data.
  
  Just my thoughts!
  
  > **Comments:**
  > **username_0**: Great, thank you. This is the kind of info I'm looking for!  
  
  ---
  
  ### Answer by username_2 on 2022-03-15. Score: 2
  
  I don't think there is a real ERD or Object documentation. There is <https://doc.symbiotic.coop/dev/civicrm/latest/schema/index.html> but by itself doesn't tell you what is what.
  
  You might want to use the built-in export feature to get a feel for the various entities: Search - Find XXX - then from the actions dropdown on the results page choose Export.
  
  The main table is civicrm\_contact. Almost everything is connected to it in some way.
  
  > **Comments:**
  > **username_3**: what is it about the ER diagram at for example https://doc.symbiotic.coop/dev/civicrm/latest/schema/tables/civicrm_email.html that means it is not a 'real ERD'? (keen to understand)  
  > **username_2**: It show foreign keys which helps, but it's reverse engineered from the db, not starting from how objects are related. Something with "logical" vs "physical" groupings would be helpful. e.g. civicrm_domain seems useful in that diagram but how is it really related. What is civicrm_wordreplacements logically related to?  
  > **username_1**: My understanding here is an ERD is just that, its not Logical otherwise it wouldn't be an ERD. We use Navicat or MySQL workbench to reverse engineer ERDs all the time and they are real as they represent the database as it stands.  
  
  ---
  
  