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.- 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.
- Stop dblogd by executing the following command on the server:
/usr/etc/venture/bin/dblogd -k
- Log in to the MySQL console from the server command line by executing the following command:
/usr/etc/venture/bin/mysql -u root -p
- Enter the MySQL root password when prompted.
Note: The default password isxinetrlz
. - Once you are logged in, change the database to
webnative
:
use webnative;
- 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. - 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 yourLIKE
statement is correct. If you want to view all of the paths that will change, you can run the same command withoutLIMIT 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%';
- 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:The number in the- 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).
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
. - Replace the number
- 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. - Change the path in the
activepath
,filerename
,failedpreview
, andvolume
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%'); - Replace the number
- Close the MySQL session by running the following command:
quit
- Start dblogd by running the following command:
/usr/etc/venture/bin/dblogd
Comments
0 comments
Please sign in to leave a comment.