Due to a pending hardware failure—it became necessary to relocate the Software Library to another server/location.
The entire sub folder structure of the current library and their contents were copied to the following share path, and the Software Library was reconfigured in the console to point to the same path: \\SMP-TLI-Corp\Software Library\
After copying the library files to the new server the old server was taken down.
When the SMP attempted to run the NS.Package Refresh schedule, or the NS.Package Distribution Point Update Schedule a warning and error similar to the following (excerpt) was seen in the SMP logs.
Management Platform 7.6x, 8.0x, 8.5x
Unable to manage the distribution points for package: 'WireShark 1.4.0 Package' WireShark 1.4.0 Package (85d2b26b-c68f-40b5-bb26-09d8712d1ef8~) An unknown error has occured while accessing path '\\SMP-T2\Software Library\ WireShark 1.4.0 Package (85d2b26b-c68f-40b5-bb26-09d8712d1ef8~) .
Unable to refresh the codebase information for package: 'WireShark 1.4.0 Package' WireShark 1.4.0 Package
(85d2b26b-c68f-40b5-bb26-09d8712d1ef8~) An unknown error has occured while accessing path '\\SMP-T2\Software Library\ WireShark 1.4.0 Package (85d2b26b-c68f-40b5-bb26-09d8712d1ef8~) .
The errors identify the path that can no longer be accessed.
Now, it would be easy enough to edit an individual package and change the path to the correct location; but it became very difficult when having to do this for hundreds or even thousands of packages.
Existing packages retain their original properties and path references after the Software Library has been changed.
Attached to this article is a SQL script (Script to change path to packages.sql) that can be run against the database.
As with any script that externally modifies the database it is IMPORTANT to have a recent backup of the database before proceeding.
Open SQL Management Studio on the database server (or wherever it is installed) then copy and paste the content of the script into a window pointing to the SMP’s database.
If you wish to modifiy a specific package change the variable "@packageId " from '00000000-0000-0000-0000-000000000000' to the Guid of the desired package. If you do not then the script will assum you want to search for the old path and change it to the new path in all packages.
Modify the @oldPath and @newPath variables in lines 3 & 4 to reflect what the script is looking for, and what it will be changing.
If you are uncertain what to put in run the following script first. It will return all packages with a XML link in the far right “State” column.
If you click on the XML link it will show the current properties of the package. Look for what is set in the “location=”node of the XML.
Once the correct old name or path pattern is identified and the new path is set then execute the script.
Note: If you want to do a controlled test to see if it is doing it correctly uncomment the last line and put in a valid GUID (returned by the query above) and it will only change the one package.
After executing against the one package, run the above query again, click on the XML link for that package and verify if the path is correct. If so then remove the last line or comment it out again and run the script. It will change every package object in the database where if fines an exact match for the @oldPath variable and change it to the value of @newPath.