Problem Scenario:
\\servername\Software Library
Example: \\servername\Software Library\85d2b26b-c68f-40b5-bb26-09d8712d1ef8\
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 '\\SMPServername\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 '\\SMPServername\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.
Management Platform 7.6x, 8.x
Existing packages retain their original properties and path references after the Software Library has been changed.
With recent releases, we have added ways to minimize this type of issues about moving package locations:
1. About Software Library UNC location
If there is the same UNC path specified (if you needed to move this shared folder from drive C: to another drive) then the SMP Server will access it and will see same folders structure and expected folders with GUIDs of previously uploaded Software packages in library.
Example when Software Library UNC path is \\servername\foldername
In case if you are using UNC path as ServerName\DriveLetter$\SharedFolderName (\\Imagexserv\S$\SW Library test), then on attempt to change it, we offer different options to perform this change with existing packages.
Example when you had Software Library path with shared folder on C drive but now going to change it to S drive for same shared folder name (Shared Software Library folder is already uploaded to S:\ drive then you will need to use option "Change existing packages").
2. For Patch Management solution, there is a similar way when you copy existing "Updates" main folder from "C:\Program Files\Altiris\Patch Management\Packages\Updates\" and upload this folder on another drive.
After this, set another location for patch updates on "Core Services" console page.
NOTE: Workaround in case you need to clean up / adjust the path for some other type of packages:
Attached to this article is a SQL script (Script to change path to packages.sql) that can be run against the database.
Usage:
Example:
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.
select Guid, Name,CAST(state as xml) State
from vRM_Package_Item
order by Name
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.
Suggestion 2:
The following suggestion applies to only one package that needs to be updated with a new server name as its primary location.
1. Identify the GUID for the package:
select * from RM_ResourcePackage_Item
where name like '%mypackagename%'
2. Using the GUID found with the query above, verify the current path by opening the link generated by this query:
select Guid, Name,CAST(state as xml) State
from RM_ResourcePackage
where guid = '6C9A1F51-90DD-40F6-BAFB-759AA2E0A110' --Example GUID.
3. Run the following query to update the server name:
--begin tran
declare @oldRootPath nvarchar(50) = 'OLDPS1-Altiris'
declare @newRootPath nvarchar(50) = 'NEWPS2-Altiris'
declare @packageId uniqueidentifier = '6C9A1F51-90DD-40F6-BAFB-759AA2E0A110' --current package GUID
UPDATE RM_ResourcePackage
SET [State] = replace(cast([State] as nvarchar(max)),
@oldRootPath,
@newRootPath),
ModifiedDate = getdate()
WHERE Guid = @packageId
UPDATE RM_ResourceSoftware_Package
SET [State] = replace(cast([State] as nvarchar(max)),
@oldRootPath,
@newRootPath),
ModifiedDate = getdate()
WHERE Guid = @packageId
--commit tran
4. Run NS.Package Refresh from Task Scheduler on your SMP Server
5. Verify that the new server name is used on the package source by following step 2 above on this section.