I have SOMEHOW duplicated my entire MEDIA collection

Hello, I have duplicated my entire media collection of 7,000 items. I now have over 14,000, with two of every item EXCEPT for ones I have added in recent weeks.

I don’t know how or when I did this. Many of the original 7,000 are not yet used, so I can’t just list the unused ones.

I had the idea of deleting all the ones from 7,000 to 14,000 apart from recent additions, but when I sort them on MEDIA REF (Ixxxxx) they are not in true numerical sequence.

I had started deleting them manually in batches of 20, but it is going to take too long. I am a longtime GRAMPS user, but I know very little about the internal workings. How should I fix this problem, please?

Martin

By “not yet used” do you mean that the records are not linked with a person, event, etc? To be clear, if you edit the media record the References Tab is empty?

If this is true, you can create a custom filter General filters >> Media objects with a reference count of <count> with the values equal to 0

The resulting list would be safe to delete. But to be safe, make sure you have a backup before the batch delete.

5.2 has a quicker delete, in seconds. But it does not allow for an undo option.

Dave, it looks like you have saved me yet again. Thank you. One question before I try this on 5.1.6.

(Yes, By “not yet used” I mean that the records are not linked with a person, event, etc. If I edit the media record the References Tab is empty.

If I do as you suggest, I assume that I will be deleting some media items NOT YET USED. After doing that, do I just use the “Tools - Utilities - Media Manager - Add images not included in database” option to add Media items again?

I haven’t been very diligent in USING media items yet, so the bottom right corner shows 13,254 in the list I generated (as you described above) out of 13,774. So I would be deleting 13,774 MINUS 13,254 items? I would then add them, about 6,500 items again, using Media Manager. Is that correct?

I wish I knew what I did to accidentally add them a second time.

Martin

Wouldn’t it be easier, and faster, to use the Remove unused objects tool? It works in its own window, so there’s no refreshing of the media view, and you don’t need to create a filter for that either.

Deleting the Gramps record for media records that are not being used by a Person, Family, Event, etc does not affect the raw media file on your hard drive. I have many media files I brought home from the library’s ancestry account that I have not yet added to Gramps. When needed I can easily add them.

I thought about how you maybe came about to have these duplicated records. Did you ever drag-n-drop the media files on your hard drive to either the Media view or to a Gallery Tab.

It has been a while since I used the Remove Unused Objects tool so unsure of the speed. As I clean my database I use the filter I described (references = 0) to first clean events, then the Citations and finally the Notes.

Another alternative is to create a Gramps XML export of all people and events but set the References filter to exclude objects not used by anything else. The problem with that method, at least for myself, I know I have objects in the database that I created but not yet used. These would be excluded from the export.

Enno, are you suggesting that I do that and then just use the “Tools - Utilities - Media Manager - Add images not included in database” option to add Media items again?

Martin

Dave, no, I’ve never used drag and drop. The only possible thing that I did, which I have done many times before without a problem, is to use the ‘Replace substrings in the path’ option.

Martin

Yes. I use it a lot, but I need to add that I never used it on that many objects.

Dave and Enno, thanks for your help. I think all is well now, and I’ve learned a lot in the process.

Martin

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.