Changing the Root Path in the Xinet Database

Overview


There might be cases where you will need to change the root path in the Xinet database. For example, you have upgraded your storage solution, and the mount point has changed.

Please follow the process below in order to change the root path in the Xinet database. 



Process

Note: In this example, we are changing the mount point of the volume from /raid1 to /Volumes/raid. Make sure to replace the values according to your environment.
  1. Make a full backup of the database. From the WebNative portal, navigate to DATABASE > Admin > backup. Click on the Full Backup Now button located at the bottom of the page.

    mceclip2.png

  2. Stop dblogd by executing the following command on the server:

    /usr/etc/venture/bin/dblogd -k
  3. Log in to the MySQL console from the server command line by executing the following command:

    /usr/etc/venture/bin/mysql -u root -p
  4. Enter the MySQL root password when prompted.
    Note: The default password is xinetrlz.
  5. Once you are logged in, change the database to webnative:

     use webnative;
  6. Run the following query, replacing raid1 with the name of your actual root path:

    select length('/raid1')+1;

    Note down the output of the command.
    In this example, the output will be 7.
  7. Run the following query to check the paths that you are going to change (replace raid1 with your actual root path):

    SELECT Path FROM Path WHERE Path LIKE '/raid1%' LIMIT 20;

    This will show only the first 20 paths, which should be enough to make sure that your LIKE statement is correct. If you want to view all of the paths that will change, you can run the same command without LIMIT 20. However, you should run the following query to check that you are not going to get hundreds of thousands of results:

    SELECT count(*) FROM Path WHERE Path LIKE '/raid1%';
  8. Change the path in the path table by running the following command:

    UPDATE path SET Path=CONCAT('/Volumes/raid', SUBSTRING(Path,7)) 
    WHERE Path LIKE ('/raid1%') ORDER BY PathID;
    Notes:
    • Replace the number 7 with the value from step 6.
    • Replace raid1 with your actual root path.
    • Replace /Volumes/raid with your new root path.
    • Make sure to use the same spacing as shown above. Capitalization does not matter (except for the name of the path).
    The number in the SUBSTRING argument represents the character number from which the command will start copying the subfolders. In this case, we will skip the first 6 characters (/raid1) and start with the 7th character.

    For example, if the name of the existing path is /raid1/job45678, this command would put /Volumes/raid at the beginning of the new path and add the subfolders starting with the seventh character (/job45678). The new path would be /Volumes/raid/job45678.
  9. Check to see that the paths have changed successfully by running the following query:

    SELECT count(*) FROM Path WHERE Path LIKE '/raid1%';

    The command should return 0.
  10. Change the path in the activepath, filerename, failedpreview, and volume tables by running the following statements:
    Notes:
    • Replace the number 7 with the value from step 6.
    • Replace raid1 with your actual root path.
    • Replace /Volumes/raid with your new root path.
    UPDATE activepath SET activePath=CONCAT('/Volumes/raid', SUBSTRING(activePath,7)) 
    WHERE activePath LIKE ('/raid1%');
    UPDATE filerename SET OldName=CONCAT('/Volumes/raid', SUBSTRING(OldName,7)) 
    WHERE OldName LIKE ('/raid1%');
    UPDATE filerename SET NewName=CONCAT('/Volumes/raid', SUBSTRING(NewName,7)) 
    WHERE NewName LIKE ('/raid1%');
    UPDATE failedpreview SET File=CONCAT('/Volumes/raid', SUBSTRING(File,7)) 
    WHERE File LIKE ('/raid1%');
    UPDATE volume SET Path=CONCAT('/Volumes/raid', SUBSTRING(Path,7)) 
    WHERE Path LIKE ('/raid1%');
  11. Close the MySQL session by running the following command:

    quit
  12. Start dblogd by running the following command:

     /usr/etc/venture/bin/dblogd

 

Back to top

Comments

0 comments

Please sign in to leave a comment.