Export the package to new server - SSIS Migration

use msdb
DECLARE @ServerSource varchar(255) = 'source_server_name'
DECLARE @ServerDest varchar(255) = 'destination_server_name'


;WITH CTE_Recursiv (Package,FolderID)
AS
(
SELECT
      CAST(name as sysname) Package,
      folderid
FROM
      sysssispackages
UNION ALL
SELECT
      CAST(f.foldername + '/' + C.Package as sysname) Package ,
      f.parentfolderid folderid
FROM
      sysssispackagefolders f
INNER JOIN CTE_Recursiv C on C.folderid = f.folderid           
)
SELECT
      'dtutil /SQL "' +
      RIGHT(Package,LEN(Package) - 1)
      + '" /SourceS ' + @ServerSource + ' /COPY SQL;"'
      + RIGHT(Package,LEN(Package) - 1) 
      + '" /DestS ' + @ServerDest Comando
FROM CTE_Recursiv
WHERE FolderID IS NULL
ORDER BY
      Comando