[Solved] Database double contents after ‘Add or update folders’ and ‘Relocate’

Started by jomax2, November 08, 2015, 12:34:24 PM

Previous topic - Next topic

jomax2

By accident, all my files were added a second time into my database today. How can I undo that? See below how it happened. Every physical file is one time on my disk but two times in my database. I guess 'find duplicates' is not a solution because that is to find identical physical files on the disk, not database entries linked to the same physical file. A solution would be if I could filter all database entries that were inserted today and simply delete those (from the database only, not from the disk!). Help please!

Here is how it happened. I closed Imatch, moved the root folder of my images to a new location (from NAS share A to NAS share B). I opened Imatch (V5.4.12), tried to relocate from A to B. Relocating failed (I now know why but that's a different story), I tried "Add or update folders" on the new location (share B). Imatch started scanning and adding the new root folder to my database. I found no way to stop it and the next morning folder B was added clean to my database. So the 'Media and folders' pane showed both locations A (still offline) and B (online but fresh). The database size had doubled from 1 to 2 GB (also after compacting). Sadly at that time I did not delete folder B from my database while I still could. Then I updated the Imatch program (from 5.4.12 to 5.4.18) which made no difference. Then I manage to 'Relocate' the database location 'A' to the new file location B. Now the 'Media and folders' pane shows only one root folder but the file window shows each file twice. One shows the categories I assigned in the past, the other does not.

thrinn

The first option would be to restore the database file from your backup to the state before you started to relocate. I understand the image files are untouched, only referenced doubly in the database.
If you don't have a backup, you can identify the images most recently added in the Collections view. Maybe it is enough to use the "remove from database " function on those images added last.
Of course you should backup your current state of affairs before starting to experiment.
Thorsten
Win 10 / 64, IMatch 2018, IMA

jomax2

Thanks a lot Thorsten!

Your option 2 worked like a charm. The 'Recently added' collection in the Collections selected exactly the database entries that had been added today. I unpaused the Files window, selected all files (Ctrl+A), then, removed these from the database. The Imatch help says about this:
QuoteOn the rare occasion where you may need to remove a file from the database, but not from the disk, you can use the Remove File(s) from Database command available in the context menu of the file window, in the Additional Functions sub-menu. This command removes the file entry from the database, and also all associated data. The file on disk is not deleted.
After 50 minutes of heavy chewing, Imatch had removed the items from the database and the original items were still present. After compacting the database size was back to its original size.

I did backup my files, but that wasn't needed (after the fact). The file count differences which I noticed were probably caused by something unrelated (for example, non-image files, like sound files).

Thanks once more! Jan