Answers.Body: <p>You might look at the API cvs Importer extension. 
  <a href="https://civicrm.org/extensions/api-csv-import-gui" rel="nofollow">https://civicrm.org/extensions/api-csv-import-gui</a></p>
  
  <p>I've found the extension extremely helpful for creating all kinds of CiviCRM data from CSV formatted data.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T08:29:05.303Z
Answers.Text: Don't know if we'll get the chance to use it ourselves, but thanks, that looks interesting.
Answers.UserDisplayName: DaveFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T10:30:43.190Z
Answers.Text: I just used it recently to import a bunch of entries into option groups. Saved me a TON of data entry.
Answers.UserDisplayName: Dan O'Brien
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-05T04:39:18.403Z
Answers.LastActivityDate: 2016-06-05T04:39:18.403Z
Answers.UserDisplayName: Dan O'Brien
Answers.Body: <p>As far as I know there is no Import Cases in the UI. So importing into the database would be the solution, but make sure you respect all the data models! You need to add data to civicrm_case, civicrm_case_contact, probably civicrm_case_activity and civicrm_activity and for the roles into civicrm_relationship.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-03T08:42:10.623Z
Answers.LastActivityDate: 2016-06-03T08:42:10.623Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>I've just bulk created a whole load of cases from activities, taking the subject, clients etc from the activity. Creating cases through the API works fine. Can post the code if anyone's interested.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T08:48:53.450Z
Answers.Text: Dave - am sure someone would appreciate that even if they aren't looking yet
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T09:16:53.170Z
Answers.Text: Sure, here it is: https://gist.github.com/davidknoll/8ad934d8736459c98e445f91576c719d (please note, this is not general as it contains IDs from our system)
Answers.UserDisplayName: DaveFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T08:26:44.467Z
Answers.LastActivityDate: 2016-06-08T08:26:44.467Z
Answers.UserDisplayName: DaveFF
Answers.Body: <p>I've been working out the queries to do this for the past week or so for a client who is migrating from an old desktop database.</p>
  
  <p>Here's the full list of tables involved:</p>
  
  <p><strong>civicrm_case</strong></p>
  
  <p><strong>civicrm_case_contact</strong> (to link each case to a contact id)</p>
  
  <p><strong>civicrm_activity</strong> (to create the necessary activities for each case)</p>
  
  <p><strong>civicrm_case_activity</strong> (links activity to case id)</p>
  
  <p><strong>civicrm_activity_contact</strong> (multiple records for each activity)</p>
  
  <p><strong>civicrm_relationship</strong> (relationships between case subject and assignees)</p>
  
  <p>You can actually get away without filling in the relationships if this is purely historical data but it's only an extra query so you may as well fill it in.</p>
  
  <p>I created a special case type for the data import and used the subject field to store details about the old cases during the SQL imports. I removed all required activities but one from this case type which simplified the import process.</p>
  
  <p>When in doubt, just create test cases under a dummy contact and see what values are populated.</p>
  
  <p>EDIT: I decided to write up the entire procedure on my website. You can find the details here - 
  <a href="http://www.drewslair.com/2016/06/importing-case-data-civicase/" rel="nofollow">http://www.drewslair.com/2016/06/importing-case-data-civicase/</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T10:29:30.697Z
Answers.Text: -1 for the fact it's really preferred to use an API call (or the API importer) rather than inserting directly into the SQL tables. API calls make sure that the relationships of data between and among the database tables is consistent. Inconsistent data can wreak havoc with upgrades.
Answers.UserDisplayName: Dan O'Brien
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-25T21:04:51.173Z
Answers.Text: That aside, it is an amazing write up that Andrew did
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-04T22:00:40.130Z
Answers.LastActivityDate: 2016-06-08T23:58:00.563Z
Answers.LastEditDate: 2016-06-08T23:58:00.563Z
Answers.UserDisplayName: Andrew Comeau
Body: <p>A client has many cases in spreadsheets, and Civicase looks very suitable.  I cannot see any facility to import cases into Civi via the UI.  Is this possible? I guess the alternative is to import directly into the database. Any suggestions?</p>
  
Tags: <civicase><4.6>
Title: Is is possible to import cases into Civi
ThreadText: # Is is possible to import cases into Civi
  
  (Asked by: username_0 on 2016-06-03)
  
  A client has many cases in spreadsheets, and Civicase looks very suitable. I cannot see any facility to import cases into Civi via the UI. Is this possible? I guess the alternative is to import directly into the database. Any suggestions?
  
  **Tags:** civicase, 4.6
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2016-06-05. Score: 3
  
  You might look at the API cvs Importer extension.
  <https://civicrm.org/extensions/api-csv-import-gui>
  
  I've found the extension extremely helpful for creating all kinds of CiviCRM data from CSV formatted data.
  
  > **Comments:**
  > **username_2**: Don't know if we'll get the chance to use it ourselves, but thanks, that looks interesting.  
  > **username_1**: I just used it recently to import a bunch of entries into option groups. Saved me a TON of data entry.  
  
  ---
  
  ### Answer by username_3 on 2016-06-03. Score: 2
  
  As far as I know there is no Import Cases in the UI. So importing into the database would be the solution, but make sure you respect all the data models! You need to add data to civicrm\_case, civicrm\_case\_contact, probably civicrm\_case\_activity and civicrm\_activity and for the roles into civicrm\_relationship.
  
  
  ---
  
  ### Answer by username_2 on 2016-06-08. Score: 1
  
  I've just bulk created a whole load of cases from activities, taking the subject, clients etc from the activity. Creating cases through the API works fine. Can post the code if anyone's interested.
  
  > **Comments:**
  > **username_4**: Dave - am sure someone would appreciate that even if they aren't looking yet  
  > **username_2**: Sure, here it is: https://gist.github.com/davidknoll/8ad934d8736459c98e445f91576c719d (please note, this is not general as it contains IDs from our system)  
  
  ---
  
  ### Answer by username_5 on 2016-06-04. Score: 0
  
  I've been working out the queries to do this for the past week or so for a client who is migrating from an old desktop database.
  
  Here's the full list of tables involved:
  
  **civicrm\_case**
  
  **civicrm\_case\_contact** (to link each case to a contact id)
  
  **civicrm\_activity** (to create the necessary activities for each case)
  
  **civicrm\_case\_activity** (links activity to case id)
  
  **civicrm\_activity\_contact** (multiple records for each activity)
  
  **civicrm\_relationship** (relationships between case subject and assignees)
  
  You can actually get away without filling in the relationships if this is purely historical data but it's only an extra query so you may as well fill it in.
  
  I created a special case type for the data import and used the subject field to store details about the old cases during the SQL imports. I removed all required activities but one from this case type which simplified the import process.
  
  When in doubt, just create test cases under a dummy contact and see what values are populated.
  
  EDIT: I decided to write up the entire procedure on my website. You can find the details here -
  <http://www.drewslair.com/2016/06/importing-case-data-civicase/>
  
  > **Comments:**
  > **username_1**: -1 for the fact it's really preferred to use an API call (or the API importer) rather than inserting directly into the SQL tables. API calls make sure that the relationships of data between and among the database tables is consistent. Inconsistent data can wreak havoc with upgrades.  
  > **username_4**: That aside, it is an amazing write up that Andrew did  
  
  ---
  
  