Moving Files Within a Volume Migrated from macOS to Linux Causes Missing Metadata

Overview

You have migrated your Xinet installation from macOS to Linux and notice that when you move files between folders on your /Volumes/ mounted Volumes, the asset metadata is being lost. You see that Xinet has created a symbolic link between the old path and the new path.

 

Solution

During the migration, Xinet will establish a symlink between the non-existent old macOS /Volumes/ path to the new Linux mount point. While this enables access to your existing content, it is suggested that you adjust the Volume paths to avoid issues with metadata being lost when moving assets between folders.

Consider an example where you previously located your Xinet Volumes at /Volumes/raid and they are now located at /raid. When checking the path set within Xinet, you see that it is still referencing /Volumes/raid, which is symlinked to the new /raid path:

mceclip0.png

 

Manually Adjusting Volume Paths

The commands below use the example paths above as placeholders. When executing these commands within your own environment, adjust the commands below as appropriate for your actual system paths.

    1. Make a Full Backup of the Venture DB before proceeding.

    2. Stop the dblogd process:
      # /usr/etc/venture/bin/dblogd -k
    3. Login to the Mysql Console:
      # /usr/etc/venture/bin/mysql -u root -p
    4. Switch to the Webnative database:
      mysql> use webnative;
    5. Verify the total existing instances of the old path:
      mysql> SELECT count(*) FROM Path WHERE Path LIKE "Volumes/raid%";
      1. Note: Consider adding a LIMIT to this statement if you have many paths matching the string.

    6. Update the path in the path table:
      mysql> UPDATE path SET Path=CONCAT("/raid", SUBSTRING(Path,12))
                WHERE Path LIKE ("Volumes/raid%") ORDER BY PathID;
    7. Check that you updated all paths:
      mysql> SELECT count(*) FROM Path WHERE Path LIKE "Volumes/raid%";
      1. Note: This should return a count of 0.

    8. Change the path in the activepath, filerename, failedpreview, and volume tables.
      mysql> UPDATE activepath SET activePath=CONCAT("/raid", SUBSTRING(activePath,12))
              WHERE activePath LIKE ("Volumes/raid%");
      mysql> UPDATE filerename SET OldName=CONCAT("/raid", SUBSTRING(OldName,12)) WHERE OldName LIKE ("Volumes/raid%"); mysql> UPDATE filerename SET NewName=CONCAT("/raid", SUBSTRING(NewName,12)) WHERE NewName LIKE ("Volumes/raid%"); mysql> UPDATE failedpreview SET File=CONCAT("/raid", SUBSTRING(File,12)) WHERE File LIKE ("Volumes/raid%"); mysql> UPDATE volume SET Path=CONCAT("/raid", SUBSTRING(Path,12)) WHERE Path LIKE ("Volumes/raid%");
    9. Restart the dblogd process.
      # /usr/etc/venture/bin/dblogd
Note: When using the UPDATE statements above, be sure to use spacing exactly as shown. Capitalization doesn't matter except in the pathname itself.

The CONCAT command will take the new beginning of the path (the first argument; in this case, "/raid") and then continue with the end of the existing path, minus some characters at the beginning of the existing path. The number in the second SUBSTRING argument represents the character position from which to start copying the existing path. In this case, we will skip over the 12 characters in "Volumes/raid" and start with the 13th character.

So, for example, if the existing pathname was "Volumes/raid/job45678", this command would put "/raid" at the beginning of the new path and add the end of the existing path starting with the thirteenth character -- "/job45678" -- for a new path of "/raid/job45678."

 


Testing

Test moving an asset to a new folder within your Volume; the asset should retain the metadata assigned after being relocated.

Comments

0 comments

Please sign in to leave a comment.