3

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"? – Laryn - CEDC.org Jun 30 '15 at 17:28
  • Yes, I was just curious if there was a way inside the actual civicrm interface. – Vito Mantese Jun 30 '15 at 20:31
4

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)

| improve this answer | |
  • Complete answer and then some. Luckily, I regularly backup my database but was hoping there was a quicker fix. – Vito Mantese Jul 2 '15 at 18:14
1

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.

| improve this answer | |

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.