I could do exports of contents from each database, accumulate these in a common directory only adding files if not already present, and then load everything in from this directory at the end. I was looking to avoid this approach if possible since I really just need database contents to move locally but if this needs to turn to OS file system exports, then that is a valid approach. I just need to be sure to export all of each item type that is present in the routine database (classes, routines, projects, etc) and import them using their respective APIs. Should a category of item that is stored in a routine database be added in the future I would need to account for this and explicitly add it to the list.

Very clever! Yes, I think I could create a Namespace that points to just the routine database of interest, merge over contents to target (since everything from that MERGER Namespace is desired), use this intermediary for each database of interest, then clean up at the end. Per Eduard's point above regarding conflicts, is there any way to pre-empt conflict using such tooling? If 2 databases have a class of the same name defined, how can I prevent clobbering the contents merged from the first database when I merge the second? Even if it is a conservative approach of failing to move code if there is any overlap, I think that would be preferable to overwriting existing code.

Tricky bit there is forming that list. DataMove seems to be per source Namespace rather than per source database.  Is there a good way to get a list of all relevant contents from a specific routine database? This would be all classes, mac routines, int routines, projects, and more, but only those that are defined in the default routine database with care to not move mapped items.

A common mapped database is essentially the end result. The question here is not asking about the end result, but rather how we get there for an already existing system. Say we have a customer with an instance that already has a good deal of custom code across multiple databases. How do we move all of this code spread across multiple default routine databases to a single location so then all Namespaces can use a mapping to access it in one place?

Apologies for the late reply! We hook into OnAfterCompile and check if the compiled item is a Business Host class. If so, this triggers a search for any config items and triggers a restart if they are instances of that class. The reason this is only available to IRIS 2019.4 and up is I believe this is when the temporary stop and start functionality was added as we did not want this feature to alter the Production Definition.

I found no direct documentation but got some information from the method documentation of the NextProcess class method in %SYS.ProcessQuery:

https://docs.intersystems.com/iris20243/csp/documatic/%25CSP.Documatic.c...

So, it seems passing an argument works like $order on the list of running processes with the caveat a halted process is treated like $zjob("") and returns the first process id in the list. I think this will do the trick, thanks Alice!

It sounds like what you want is to use XMLNIL. This will export null object Properties as  xsi:nil="true". Then on import the default behavior is to set such a valued Property to be a new instance of that object with no Properties set. See Handling Empty Strings and Null Values | Projecting Objects to XML | InterSystems IRIS Data Platform 2024.3
for more information.

One way I can think of is to get the name of each config item that is enabled via an SQL query such as:
SELECT Name, ClassName FROM Ens_Config.Item WHERE Production = '<production name>' and Enabled = 1

Then for each of these call ##class(Ens.Director).EnableConfigItem("<production name>||<config item name>|<config item class name>", 0)

I am not sure of any method to do it all at once.

I really enjoy taking things apart and breaking them down into basic components to see how they work. I found it useful to insert break statements in a confusing piece of code and run it from terminal (can also use the ObjectScript debugger from VS Code with breakpoints). Then I could write out the values at each break and reverse-engineer what the command/method must do. I also really enjoy the ability to drill down into the code and read the definition of a method. If you are curious how any method works you can just Ctrl+Click from VS Code to go to that method's definition(Ctrl+Shift+G from Studio).

If this was tied to your Windows password and you recently changed it then you may need to change the credentials for the service.

Try searching for "Services" in the windows search box and open the app. Then find the service associated with this instance (I think it would be InterSystems IRIS Controller for LATEST) and open properties and go to log on tab. Change the credentials here to match your OS credentials and then try starting your instance. Hope that helps!