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!
Changed HDD, help resyncing Tags/Comments to new path
Re: Changed HDD, help resyncing Tags/Comments to new path
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...
Apart from that the database needs to be sorted naturally otherwise it won't work as it should...
One of my scripts helped you out? Please donate via Paypal
Re: Changed HDD, help resyncing Tags/Comments to new path
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
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?
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
One of my scripts helped you out? Please donate via Paypal
Re: Changed HDD, help resyncing Tags/Comments to new path
Several, not exactly sure but definitely two on the PC, plus a network drive on a NAS.
both files and folders- Are only files tagged or folders as well?
Correct, as in your first example below.- 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
Change these values in the script:
This variable is meant to contain your two volume serial number for the two drives and one UNC path for the share...
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^^
Code: Select all
// Replace old with new volume serial numbers
// <old volume serial>|<new volume serial>
// One line for each entry!
$replacedVolumeSerials = <<<>>>
D673C97B|727BA73D
>>>;
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
>>>;
- 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^^
One of my scripts helped you out? Please donate via Paypal
Re: Changed HDD, help resyncing Tags/Comments to new path
Awesome, thx!
I'll give that a try
I'll give that a try
XYplorer Beta Club