Does anyone know how I can revert a contact import (via the upload contacts script included in the site). The process included merges with existing contacts.

  • Did you back up your database before clicking "Import"? Jun 30, 2015 at 17:28
  • Yes, I was just curious if there was a way inside the actual civicrm interface. Jun 30, 2015 at 20:31

2 Answers 2


To revert an import done with the import functionality at Contacts > Import Contacts, you will need to restore from your backed up database file. As far as I know, there is no automatic "undo" on imports.

To your point, it might be worthwhile to add a new warning to the import "Are you sure" verification message that pops up right before the import fires: Import warning

For example, "Are you sure you want to import now? Be sure you have backed up your database as there is no 'undo' for this." (Update: I submitted a patch so if the core team agrees this will be added in future versions)

  • Complete answer and then some. Luckily, I regularly backup my database but was hoping there was a quicker fix. Jul 2, 2015 at 18:14

Note that if you have advanced logging turned on, there's an option to revert - though changing an import would require you know the names of all the tables touched by the import. See the script on this answer for doing the reversion.

The tables you'd revert would always include civicrm_contact, but also potentially civicrm_address, civicrm_email, civicrm_phone, civicrm_website, civicrm_im, and civicrm_relationship. Fortunately there's no real harm in specifying tables that weren't touched.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.