Page 1 of 1

Changed HDD, help resyncing Tags/Comments to new path

Posted: 03 Nov 2024 15:29
by chumbo
Hi,
I recently replaced a drive and made other changes to paths & folders so I need to correct the Tags path to match the correct file on the HDD.
What is the best and fastest way to go about it?
Is there maybe some script that would speed things up? Ideally, I'm hoping for a quasi-automated system that could scan drives for the file names and then assign that newly found path to the tag.dat. That's just an ideal solution but what's second best to that? How would you go about it?

Currently, the only way I've found is to look at the orphaned list in XY, find the new files location and since it most cases, it's a whole bunch of files that are orphaned because of a change in the path/folder name, then using a text editor, using the 'Replace' function, I only need to change that path/folder name in the tags.dat to get all those files to find their matching tags.

However, that is still a very slow and tedious process since I have +-1000 to correct so just curious if there's a better way of doing this.

Also, another odd problem is that I can't change the Configuration/information/Tags/Storage drop-down menu to use anything other than 'Use volume serials'? (that's what I had been using but I would prefer to now use a more portable option like 'Relatve to tags database' but it won't save any changes I make to that setting!?
Thanks in advance!

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 03 Nov 2024 16:22
by highend
Yeah, if you don't want to do it manually you should script it. If a file name is not unique, you should present a popupmenu to select the correct one^^
Apart from that the database needs to be sorted naturally otherwise it won't work as it should...

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 03 Nov 2024 17:55
by chumbo
Thx for the reply. I was asking/hoping such a script had maybe already been written by someone or at least some script that could help in reducing the time it would otherwise take to do it the 'manual' way. I don't know how to write a script so I guess I'll have to do it the slow way :(

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 03 Nov 2024 21:41
by highend
I'm not aware of anything prewritten for such a case...

A few questions (to reduce complexity concerns):
- How many drives are involved or were ALL changes made on a single drive?
- Are only files tagged or folders as well?
- You've only done path renaming stuff , the final folder / file name was NEVER touched at all?

Code: Select all

E.g.:
D673C97B:\folder 1\file x.txt => <new volume serial>:\folder 1\folder 2\file x.txt <= Valid change
D673C97B:\folder 1\file x.txt => <new volume serial>:\folder 1\fileblabla.txt <= INVALID change
D673C97B:\folder 1\folder x => <new volume serial>:\folder 1\folder y <= INVALID change

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 03 Nov 2024 23:26
by chumbo
highend wrote: 03 Nov 2024 21:41 I'm not aware of anything prewritten for such a case...

A few questions (to reduce complexity concerns):
- How many drives are involved or were ALL changes made on a single drive?
Several, not exactly sure but definitely two on the PC, plus a network drive on a NAS.
- Are only files tagged or folders as well?
both files and folders
- You've only done path renaming stuff , the final folder / file name was NEVER touched at all?
Correct, as in your first example below.

Code: Select all

E.g.:
D673C97B:\folder 1\file x.txt => <new volume serial>:\folder 1\folder 2\file x.txt <= Valid change
D673C97B:\folder 1\file x.txt => <new volume serial>:\folder 1\fileblabla.txt <= INVALID change
D673C97B:\folder 1\folder x => <new volume serial>:\folder 1\folder y <= INVALID change

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 04 Nov 2024 20:54
by highend
Change these values in the script:

Code: Select all

    // Replace old with new volume serial numbers
    // <old volume serial>|<new volume serial>
    // One line for each entry!
    $replacedVolumeSerials = <<<>>>
D673C97B|727BA73D
    >>>;
This variable is meant to contain your two volume serial number for the two drives and one UNC path for the share...

Code: Select all

    // Volume serial(s) / UNC path(s) on which tag change(s) happened
    // Volume serial(s) without trailing ":" or ":\"!
    // UNC shares with no trailing "\"!
    // One line for each entry!
    $volumeSerialsAndUNCShares = <<<>>>
727BA73D
\\192.168.0.50\int_01_crypt
    >>>;
Hints:
- Use the lowest level root you can find (in which file / folder moves happened) for the UNC path!
E.g.: If changes happened only in \\192.168.0.50\int_01_crypt\install use that instead of \\192.168.0.50\int_01_crypt
Why? Scanning the UNC path can take a long time...
- Use the new volume serial numbers here


Now:
Make a copy of your tag.dat file!
Run the script, don't do other stuff while it is running!
Look at the status line for output
Select the correct file / folder whenever more than one match was found!

Only tested with a handful of examples^^
Fix tag database_v0.1.xys
(8 KiB) Downloaded 36 times

Re: Changed HDD, help resyncing Tags/Comments to new path

Posted: 04 Nov 2024 23:03
by chumbo
Awesome, thx!
I'll give that a try :)