diff --git a/src/cls/IPM/Utils/Migration.cls b/src/cls/IPM/Utils/Migration.cls index d36384fc..65573067 100644 --- a/src/cls/IPM/Utils/Migration.cls +++ b/src/cls/IPM/Utils/Migration.cls @@ -5,12 +5,30 @@ Class %IPM.Utils.Migration ClassMethod RunAll(verbose As %Boolean = 1) As %Status { + Set tOriginalNS = $Namespace + Do ##class(%IPM.Main).GetListNamespace(.list) + New $Namespace + Set $Namespace = "%SYS" + Set sourceDB = ##class(%SYS.Namespace).GetPackageDest(tOriginalNS, "%IPM") + + Set ns = "" Set sc = $$$OK - Try { - Do ..MigrateZPMToIPM(verbose) - Do ..MigrateReposFromIPM09(verbose) - } Catch e { - Set sc = e.AsStatus() + For { + Set ns = $Order(list(ns)) + // Perform migration for namespaces to which %IPM is mapped from the current namespace's default routine database + If ##class(%SYS.Namespace).GetPackageDest(ns, "%IPM") '= sourceDB { + Continue + } + If ns = "" { + Quit + } + Try { + Set $Namespace = $Zstrip(ns,"<>WC") + Do ..MigrateZPMToIPM(verbose) + Do ..MigrateReposFromIPM09(verbose) + } Catch e { + Set sc = $$$ADDSC(sc, e.AsStatus()) + } } Quit sc }