User Tools


How to merge duplicate records in Drupal

The NNELS repository is designed to have a single Drupal node (record) that contains multiple file attachments or formats. For example, there is 1 record for the book Homes : a refugee story and it contains 5 file attachments. (Note: this example is no longer accurate as the record has been updated, but should still illustrate the general process…)

Over time, multiple records have popped up for the same title. We need to ensure all the files for a title are in a single record. Here's how to merge all files for a title into 1 record:

  1. Go to the Duplicates: Titles view in Drupal. You'll see a list of all the records that are duplicates in the repository. Each file is on its own row. The column called Nid is important - it stands for "node identifier". In other words, the record identifier. Files that have the same Nid are located on the same record page.
    1. For example, you might see 4 files that are the same book. 3 of these files might have the same Nid, meaning they are located on the same record page. But 1 file might have a different Nid, so be on a different record page. In this case, we might decide to transfer that 1 file to the same record page where the other 3 files are located.
  2. Select all of the files that are the same book. Check the title and author fields to ensure they're actually the same book, you may even need to download the files. (Don't go by ISBN as it's not reliable in our system)
  3. Click the Transfer File Resource Entities operation button.
  4. In the Select the File Attachment to transfer field, select the file(s) that you want to move to a different record page.
    1. The important part is to look at both record pages that exist (Nid 75510 and Nid 75111) and determine which record we want to keep. Things to consider: which record has better metadata? (summary, NNELS genre terms, subject terms, collection tags, etc.). If one record is clearly better than the other, then move all files into that one. Often times it might not be clear which record is a keeper; in this case, just use your best judgment. We'll need to double-check anyways that no key data is lost before we delete the old record.
  5. In the Select the destination Repository Item field, select the record that you want to move all the above files to. In the screenshot below, we're going to move that 1 MP3 file from the record 75510 to the other record page 75111 (which currently contains 5 other files).
  6. Click Next.
  7. Click Confirm. You should be taken back to the main page/view where you'll see a message that the transfer has been successful.
  8. You'll want to double-check that the new record, which now contains all the files (Nid 75111 in our example above), also contains all the good data. Before we delete the old record, make sure any relevant genre and subject terms and collection tags also exist on the record we're going to keep. If you need to add any data into the new record then you can do so manually.
  9. Delete the old record(s) (which should have 0 files), by selecting it and then clicking the Delete item button
  10. Click Confirm and that old record should be gone for good.
public/nnels/cataloguing/merge-duplicate-records.txt · Last modified: 2023/03/20 10:38 by farrah.little