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.
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:
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. – Vito Mantese Jul 2 '15 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.