How do I force an application to recognise two names for a disk drive?

4

0

I have an extensive image database (3.25GB metadata, 90K images) held in a legacy product (idImager V5). This in turn utilises SQL Server 2005 as the underlying DBMS.

Over time, I have been adding and maintaining image information and have shifted the database to different disc drives to utilise larger discs, or to replace defective drives. I have had different locations for the database, and different locations for the images that are being managed. Disk names have changed over the period of use. All references to drives relate both to physical and logical drives. I have never had any partitioning of the drives nor multiple boot systems.

The current situation is that the database is on drive C: named "Windows7_OS". This name has never changed over the years. The images are on drive D: named "2nd System Drive". This drive has been named "New Volume" in the past.

I have some pictures stored in the database when the name was "New Volume", and some when the name was "2nd System Drive". If I try to access photos stored under the current wrong name, I get the error message

enter image description here.

If I switch the names I get the identical message (including a full path name) but relative to the other name.

Is there any way to get the image database to accept both names? My initial thought was to alias the drive - in Windows or SQL Server. I have not found a way to do this. I do not wish to work through the full metadata and image databases in order to sort out the incorrect names, nor do I wish to setup the system from scratch.

Update:

@Scott's suggestion only works when a drive on one computer is changed to one on another computer. It does not work where the same drive is captured in the database twice under different labels, but only one label is visible to the database at a time. Checking this apporach revealed that configuring the Catalog Explorer to exclude the Catalog Folders also removes this option from sight.

Update:

It has proved necessary to follow @harrymc's suggestion, in spirit though not detail. A table in the database has all the file paths containing images, and the media label for each file path. Changing the data in this table provides an exact solution to my problem. This required backing up the database, and operating with database owner privileges.

Chris Walton

Posted 2015-04-20T21:44:07.577

Reputation: 559

Not sure if this will work, but ... create a subdirectory on your computer named the same as the volume you're trying to access. Stick some images in it that should be on it. Now, map that directory to a drive letter. What will be displayed in Explorer is the name of the directory. This might fool the software into thinking the volume is there correctly. Note: This is a guess and very likely might not work... – Steve – 2015-04-20T21:48:22.547

@Steve thanks for the suggestion. As you feared it does not work. – Chris Walton – 2015-04-21T01:03:14.377

Another thing that may work: create an SMB share with the name of the volume and map it to a drive letter. Just giving suggestions in the absence of others. – Steve – 2015-04-21T04:09:31.227

Answers

1

If SQL Server 2005 checks the volume label, there is no way to hide the fact that the label has changed, so you need to change the way that the pictures are stored in the database.

The only way I can think of to change "New Volume" to "2nd System Drive" in the database, is to reimport the pictures, in the spirit of the following :

  1. Change the volume name to "New Volume"
  2. Run a query that selects all database pictures on "New Volume"
  3. Save the query result on a file
  4. Delete the pictures on "New Volume" from the database
  5. Change the volume name to "2nd System Drive"
  6. Import the saved pictures

As I don't have SQL Server 2005 to play with nor a copy of your database, I cannot go more into details. I suggest taking full backups of the database before starting.

harrymc

Posted 2015-04-20T21:44:07.577

Reputation: 306 093

+1 and accepted for suggesting a successful, and heavyweight, approach and shifting my thinking to the database from Windows aliases. Also the reminder about full backups. – Chris Walton – 2015-04-30T15:04:59.130

1

Rather than aliasing the drive, you might try using a powershell command to alias, rename, or move all the files. I would suggest moving or renaming over aliasing.

For renaming the files the cmdlet is Rename-Item or ren

Rename-Item *.html *.txt     'This renames all files ending with .html to end with .txt

For moving the files the cmdlet is Move-Item or mv

Move-Item c:\images\* d:\images\     'Moves all files from the c:\images\ directory to d:\images\

I am not sure if the renaming would work but moving should.

Magister Ludi

Posted 2015-04-20T21:44:07.577

Reputation: 19

How would that help with the volume label ? – harrymc – 2015-04-24T19:37:59.873

If you move all the files, it should reset the volume label to wherever they are moved. – Magister Ludi – 2015-04-24T19:42:34.167

1The problem is that they are stored in the database with an old volume name. The solution needs to address SQL Server 2005, not Windows. – harrymc – 2015-04-24T19:47:00.413

1I can't leave comments because I don't have the rep for it so I will ask here. Did OP use Volume Mount Points instead of Drive Letters to attach the drives to the DB? He may have to detach and reattach the drives to reset the metadata. – Magister Ludi – 2015-04-24T20:09:27.390

@Magister I don't remember how I ensured the database was changed when drive D: was added. I have never done anything specific like attaching drives to the DB. I do remember that ensuring that the database referenced the new drive in the stored metadata was a fairly trivial operation. – Chris Walton – 2015-04-24T20:36:45.603

1

I think your problem is completely IdImager related. It's catalogs must be storing the volume label and you need to update them, which shouldn't be a difficult process using IdImager.

From: http://forum.idimager.com/viewtopic.php?f=14&t=14164

Go to Catalog Folders, select the top level folder (that can be the drive ID), right click and select 'Relocate Catalog Folder'. Enter the new location (in your case that's the same as the old location) and click OK.

IIRC this should only take a few seconds or so...`

Scott C

Posted 2015-04-20T21:44:07.577

Reputation: 177

+1 and bonus for pointing me to a solution that should have worked, but failed because of the exact implementation of the feature. Also reminding me of a link to a source of information that I had overlooked. – Chris Walton – 2015-04-30T15:02:39.743