How do I copy all resources from one domain to another?

Prev Next

When you want a new domain to look exactly like an existing one, populating a target state definition with resources by hand is slow and easy to get wrong.

Copy all resources reads every resource of every listable type in a domain and adds them all to a target state definition in one pass, with live progress, a working Cancel, and a clear report of anything it could not read. Once the definition is saved, deploying it brings the target domain into line, and copying the source again later shows you exactly what changed.

Note: Copying a large domain can take many minutes. The copy runs in your browser tab, so keep the tab open until it finishes.

Prerequisites

  • A target state definition to copy into. See how to create a definition.

  • Access to the cell that owns the source domain.

  • The entitlement to save definitions.

Method

Step 1: Start the copy

Assuming a definition exists, navigate to the Configuration Management > Target State Definitions dashboard and:

  1. Open the definition in the builder and select Add resources (or Add resources from a domain if it is empty).

  2. Choose the cell and the source domain, then select Continue.

  3. On the Select resources page, select Copy all resources. It sits beside Choose resource types, both in the toolbar and in the empty state.

  4. Read the confirmation, then select Start copying.

Step 2: Watch the progress

The Copying resources from [domain] dialog opens and works through three phases. You do not need to do anything, but it helps to know what you are looking at.

  1. Listing. Admin Portal finds out which resource types the domain holds and how many resources are in each. Types that belong to a parent, such as optional properties, can only be found under their parent resource, so they are listed under every parent resource in turn. They are copied even when the parent type itself is not, for example when the parent is reference-only. The status line reads, for example, Listing Data type (12 of 87 types)… and the progress bar pulses because the total is not yet known.

  2. Fetching. Each resource is read in full. The status line reads, for example, Fetched 3,412 of 20,118 resources · 14 failed · 06:12 elapsed, and the progress bar fills.

  3. Resolving dependencies. Anything the copied resources depend on that the definition does not already hold is added as a reference, or read in full where the type has no reference form. A dependency read in full may depend on others in turn, so this repeats until nothing is left unmet.

Beneath the status line:

  • Estimated definition size updates as the copy proceeds. Above 5 MB it warns that the definition will be slow to load, compare and deploy. Above 50 MB, the hard limit for a definition file, you cannot add the copy as it stands and must cancel and copy fewer types.

  • Show N types expands a table with a row per resource type showing how many were listed, fetched and failed.

  • A Not copied: line names any resource types that were skipped, and why. See the appendix for what each reason means.

To stop early, select Cancel. Requests in flight are abandoned and nothing more is read. Everything copied so far is kept for you to decide about.

Step 3: Review the result and add it

When the copy finishes the title changes to Copied resources from [domain] and the status line summarises it, for example Copied 20,118 resources from 87 types · 14:03 · 14 failed.

If any resources failed to read:

  • Show N failed resources lists each one with its type, identifier and error.

  • Retry failed (N) reads just those again. You can retry as many times as you like.

  • Copy list puts the list on your clipboard as tab-separated text, and Download JSON saves it as a file named like copy-all-failures-<domain>-<date>-<time>.json. Either lets you investigate the failures outside Admin Portal, or decide that you do not care about them.

Then choose:

  • Add N resources to definition to bring everything copied into the builder. After a cancelled copy this button reads Keep N copied resources.

  • Discard to close the dialog with nothing added.

Step 4: Check the builder and save

Back in the builder, a message confirms what happened, for example Added 20,118 resources from [domain]. 14 could not be read and were left out.

With this many resources, every resource type starts collapsed and a banner explains why. Expand a type with the chevron beside its name, or use search and the Scope and Resource type facets. Expand all renders every row and can make the page slow, so Admin Portal asks you to confirm.

Every copied resource is held as a managed resource. New ones start with the Default write behaviour, so deploying fails on any that the target domain already holds, including the domain you copied from. If the target may already hold any of them, set the definition's write behaviour to Adopt before you deploy. See how to set write behaviour. Resources already in the definition keep the write behaviour they had. Dependencies that can be referenced are held as References.

Select Save changes. Nothing is written to your source until you do. Saving a whole-domain definition writes one file, which may take a moment.

Keeping the copy up to date

The copy replaces resources already in the definition with the domain's current values, and the builder highlights every changed cell against the version you loaded. That makes a repeat copy a review tool:

  1. Open the definition and run Copy all resources from the same domain again. Resources already in the definition keep their write behaviour.

  2. In the builder, the header shows N with edited values. Highlighted cells are exactly what changed in the source domain since your last copy.

  3. If the copy reports N resources already in the definition are no longer in the domain, those resources have been deleted from the source. They are left in the definition for you to decide about. Remove them with the bin icon if the target should lose them too.

  4. Save, then deploy.

To review changes without copying the whole domain again, use Check for changes instead. It compares only the resources the definition already manages, and lets you accept or discard each change before anything is added. Tick Look for new children to also pick up resources that belong to those, such as new optional properties. See how to check a definition for changes.

Starting again

To empty a definition, select Remove all resources in the builder header and confirm with Remove all. Every resource is removed, references included. Nothing is saved until you select Save changes, so you can still Discard changes if you change your mind.

Troubleshooting

"Couldn't list [type]; none of its resources were copied." Admin Portal could not read the list of resources for that type, so the type contributed nothing. Failed types cannot be retried from the dialog. Run the copy again, or add that type's resources by picking them. If that type is a parent, the types that belong to it are incomplete too.

"[Type] holds more resources than the copy read." A single type held more than 100,000 resources, so the copy stopped at that point for the type. The definition is incomplete for that type.

"A definition may be at most 50.0 MB, so this copy cannot be added as it stands." Select Cancel, then copy fewer types by picking them with Choose resource types, or split the configuration across more than one definition.

The copy stalls or the tab was closed. The copy runs in your browser session and cannot be resumed. Start it again. Nothing was saved, so there is nothing to clean up.

Resources I expected are missing. Check the Not copied: line in the dialog. Reference-only types, types that cannot be listed or read in full, and types whose parent can't be listed are never copied. See the appendix.

FAQs

How long does a copy take? It depends on how many resources the domain holds and how quickly it answers. The confirmation warns that large domains can take many minutes.

Is the definition a complete image of the domain? Not quite. Resource types that cannot be listed, cannot be read in full or are reference-only are left out, as are types whose parent can't be listed. Each is named in the dialog. Dependencies are followed until nothing is left unmet.

Does copying change the source domain? No. Reading a domain never changes it. Nothing changes in any domain until you deploy.

Can I copy from more than one domain into the same definition? Yes. Run the copy once per domain. Resources with the same identity are replaced by the latest copy.

Appendix: Skip reasons

Reason shown

Meaning

Its parent can't be listed

The type belongs to a parent type, and its resources can only be found by listing them under each parent resource. The copy can't do that here, because the parent type can't be listed on its own, for example because it belongs to a parent itself.

Reference only

The type can be named by a definition but never created, updated or deleted by one. Such resources appear only as references.

Cannot be listed

The platform offers no way to list resources of this type, so a whole-domain copy cannot find them. Add them individually.

Cannot be read in full

Resources of this type can be listed but not read in full. Copying only the listing would produce an incomplete definition, so they are left out.

Appendix: Limits

Item

Value

Definition file size, hard limit

50 MB

Definition file size, warning

5 MB

Resources read per type

Up to 100,000

Automatic retries per read

Up to 3, for network drops, timeouts and server errors

Dependency depth

No fixed limit. Dependencies are followed until none are left unmet.