Answers.Body: <p>I would suggest to perform deletion of contact from UI and then reseting the auto increment value through mysql command. Truncating database might loose contact that are not suppose to be deleted like logged in contact id or Default organization contact id or they might be possible to have orphan data for contacts if we directly truncate the table. Here is what i would do</p>
  
  <ol>
  <li>Find Contact</li>
  <li>Select All contact</li>
  <li>From Action list i will select 'Delete Contact permanently'</li>
  </ol>
  
  <p>Shell in for mysql or in phymyadmin through web and run <code>ALTER TABLE civicrm_contact AUTO_INCREMENT = 1</code> </p>
  
  <blockquote>
    <p>Note: Backup database before deleting contacts.</p>
  </blockquote>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T02:43:16.117Z
Answers.Text: While this is a bit better than directly removing entries via SQL queries, I am noticing that even after deleting a contact "permanently", there are still residual "Address" entities in the database that were associated with deleted contacts.  Is there a way to safely remove these also?
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T18:52:59.340Z
Answers.Text: Those address may be tied to Events. Can you check if all the address have contact_id as NULL and this address are link to civicrm_loc_block
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-07T12:59:45.237Z
Answers.Text: I already manually deleted all the address entities via the API explorer, but their contact_id fields were not NULL.
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-07T13:06:17.817Z
Answers.Text: Ohhh in that case they might have tied up with events not sure though
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-05T20:00:54.267Z
Answers.LastActivityDate: 2018-06-05T20:00:54.267Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>After having put a lot of time into customizing a CiviCRM installation, I want a way to replicate the configuration / customization / installed-extensions, but start from scratch on the contacts (so that newly added contacts -- after the admin contact and organization -- have contact-ids of 3,4,5,...).  Deleting all contacts via the UI doesn't seem to "reset" the next-contact ID counter.</p>
  
  <p>Perhaps one way this could be possible is if there were a means by which all configuration / extensions could be backed up and restored, independent of the data in the system (e.g. contacts, memberships, contributions, etc.).  Is this possible somehow?  Or is there another way to achieve my goal of "starting over" with non-configuration data?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-06T08:59:00.797Z
Comments.Text: Why do you want to start with a new contact id? If there is a need to have a unique but meaningful contact number you could also use the Identity Tracker extension: https://github.com/systopia/de.systopia.identitytracker
Comments.UserDisplayName: Jaap Jansma - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-06T14:47:55.573Z
Comments.Text: @JaapJansma-CiviCooP a "reset" contact ID isn't the main goal, but rather a fresh CiviCRM database that doesn't have any data-elements in it left-over from previous use of CiviCRM -- so really this goes beyond just contacts to anything that isn't configuration related data.
Comments.UserDisplayName: Mark
Tags: <backups>
Title: How can I clear all contacts (as if they never existed) without touching any CiviCRM settings?
ThreadText: # How can I clear all contacts (as if they never existed) without touching any CiviCRM settings?
  
  (Asked by: username_0 on 2018-06-05)
  
  After having put a lot of time into customizing a CiviCRM installation, I want a way to replicate the configuration / customization / installed-extensions, but start from scratch on the contacts (so that newly added contacts -- after the admin contact and organization -- have contact-ids of 3,4,5,...). Deleting all contacts via the UI doesn't seem to "reset" the next-contact ID counter.
  
  Perhaps one way this could be possible is if there were a means by which all configuration / extensions could be backed up and restored, independent of the data in the system (e.g. contacts, memberships, contributions, etc.). Is this possible somehow? Or is there another way to achieve my goal of "starting over" with non-configuration data?
  
  **Tags:** backups
  
  > **Comments:**
  > **username_1**: Why do you want to start with a new contact id? If there is a need to have a unique but meaningful contact number you could also use the Identity Tracker extension: https://github.com/systopia/de.systopia.identitytracker  
  > **username_0**: @JaapJansma-username_1 a "reset" contact ID isn't the main goal, but rather a fresh CiviCRM database that doesn't have any data-elements in it left-over from previous use of CiviCRM -- so really this goes beyond just contacts to anything that isn't configuration related data.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-06-05. Score: 3
  
  I would suggest to perform deletion of contact from UI and then reseting the auto increment value through mysql command. Truncating database might loose contact that are not suppose to be deleted like logged in contact id or Default organization contact id or they might be possible to have orphan data for contacts if we directly truncate the table. Here is what i would do
  
  1. Find Contact
  2. Select All contact
  3. From Action list i will select 'Delete Contact permanently'
  
  Shell in for mysql or in phymyadmin through web and run `ALTER TABLE civicrm_contact AUTO_INCREMENT = 1`
  
  > Note: Backup database before deleting contacts.
  
  HTH
  
  username_2
  
  > **Comments:**
  > **username_0**: While this is a bit better than directly removing entries via SQL queries, I am noticing that even after deleting a contact "permanently", there are still residual "Address" entities in the database that were associated with deleted contacts.  Is there a way to safely remove these also?  
  > **username_2**: Those address may be tied to Events. Can you check if all the address have contact_id as NULL and this address are link to civicrm_loc_block  
  > **username_0**: I already manually deleted all the address entities via the API explorer, but their contact_id fields were not NULL.  
  > **username_2**: Ohhh in that case they might have tied up with events not sure though  
  
  ---
  
  