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
Open the definition in the builder and select Add resources (or Add resources from a domain if it is empty).
Choose the cell and the source domain, then select Continue.
On the Select resources page, select Copy all resources. It sits beside Choose resource types, both in the toolbar and in the empty state.
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.
Listing. Admin Portal finds out which resource types the domain holds and how many resources are in each. 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.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.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.
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 with the Adopt write behaviour, so deploying it to a domain that already has the resource adopts it rather than failing. Dependencies that the domain can only reference 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:
Open the definition and run Copy all resources from the same domain again.
In the builder, the header shows N with edited values. Highlighted cells are exactly what changed in the source domain since your last copy.
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.
Save, then deploy.
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.
"[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 reached through a parent, and types that cannot be listed or read in full are never copied. See the appendix. For the full list of resource types, see LUSID configuration resource reference.
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. See the outstanding questions below.
Is the definition a complete image of the domain? Not quite. Resource types that cannot be listed, cannot be read in full, are reference-only, or are always reached through a parent are left out and named in the dialog. Dependencies are followed one level deep.
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 |
|---|---|
reached through its parent | The type cannot be listed on its own. Its resources arrive automatically as dependencies when their parent is copied. |
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 | One level |