wiki:UserGuidelines/Admin/RecordMerging

Record Merging

There are times when you have multiple records in the database which are duplicates.

For some simple 'leaf' resources it may be possible to simply delete one of them (e.g. Contacts).

However where other records point to this one, it is better to merge the 2 records together.

Web UI

Workflow

  1. Login as Administrator
  2. Bookmark the original record:
    • Find the original record in a list, or perform a search for it
    • Open the record
    • Click "Mark as Duplicate"
    • See the link change into "Unmark as Duplicate"
  3. Bookmark the duplicate record:
    • Find the duplicate record in a list, or perform a search for it
    • Open the record
    • Click "Mark as Duplicate"
    • See the link change into "Unmark as Duplicate"
  4. Open the bookmarks list:
    • Click on "Deduplicate" right next to "Unmark as duplicate"
    • See a list of all bookmarked records for this resource
  5. Select the records you want to merge
    • you must select exactly 2 records
    • then click "Merge"
    • See the merge form with both original and duplicate side-by-side
  6. Compare the records, correct what needs to be corrected
    • you can edit any field
    • you can use the swap-buttons to swap the field between original and duplicate
  7. Decide which record to keep and click either "Keep Original" or "Keep Duplicate"
    • click "Reset" to revert all changes made to the merge form
    • click "Cancel" to abort the action and return to the bookmarks list

Effects

  1. The record you chose to keep will be kept, the other record gets deleted
  2. All records linked to the deleted record will be re-linked to the record you kept
  3. Affiliations and ownership will be updated to the data in the final record
  4. Synchronized instances will be informed about the deletion and updates with the next scheduled synchronization

Important: merging records can affect access permissions. To ensure consistent permissions during the whole transaction, you must be logged in as Administrator.

CLI

Identify the 2 record IDs, decide which one you wish to keep & which one should be deprecated & then merge them as follows:

auth.override=True
resource = s3db.resource("pr_person")
# (Good, Bad)
resource.merge(117, 90)
# If succesful:
db.commit()

It is also possible to specify that some fields should be retained from the one which is being deprecated.

See Also

Last modified 8 years ago Last modified on 10/17/13 19:40:40
Note: See TracWiki for help on using the wiki.