When migrating a LANDesk core server, if your packages are still pointing to the old core server, you can change the file paths directly in the database.

WARNING: This operation is risky. Make sure to perform a backup before making this change!

Simple change

  • Identify paths with the old core server
select * from dbo.PACKAGE_FILES_HASH WHERE FULL_PATH like '%oldcoreserver.domain.lan/packages%'
  • Change the paths to the new core server
UPDATE dbo.PACKAGE_FILES_HASH SET FULL_PATH = replace(FULL_PATH, 'oldcoreserver.domain.lan/packages', 'newcoreserver.domain.lan/packages') WHERE FULL_PATH LIKE '%oldcoreserver.domain.lan/packages%'

Exemple replace http to https

  • Get Path
SELECT * 
FROM dbo.PACKAGE_FILES_HASH 
WHERE FULL_PATH LIKE 'http:%' AND FULL_PATH LIKE '%share%';
  • Replace
WITH UniquePaths AS (
    SELECT DISTINCT FULL_PATH
    FROM dbo.PACKAGE_FILES_HASH
    WHERE FULL_PATH LIKE 'http:%' 
      AND FULL_PATH LIKE 'share%'
      AND FULL_PATH NOT LIKE 'https:%'
)
UPDATE dbo.PACKAGE_FILES_HASH
SET dbo.PACKAGE_FILES_HASH.FULL_PATH = REPLACE(dbo.PACKAGE_FILES_HASH.FULL_PATH, 'http:', 'https:')
FROM UniquePaths
WHERE dbo.PACKAGE_FILES_HASH.FULL_PATH = UniquePaths.FULL_PATH
  AND NOT EXISTS (
      SELECT 1 
      FROM dbo.PACKAGE_FILES_HASH AS pfh
      WHERE pfh.FULL_PATH = REPLACE(UniquePaths.FULL_PATH, 'http:', 'https:')
  );