new `data import|export beta tree` commands
There's been a number of longstanding problems and limitations with the tree commands whose fixes required a rewrite. There's a few small breaking changes and y'all run these commands A LOT so we're releasing them through our normal beta process.
Phase 1: Beta (complete)
- introduce
data import beta treeanddata export beta tree - existing commands encourage users to try the new ones
Breaking changes between existing commands and the beta commands
-
import betaremoves the hidden, deprecatedcontent-type. Only json files are supported. Usage: ~5 per year. -
import betaremoves the--config-helpflag. The schema information is now in the command help. Usage: ~1 per week.
Other changes
-
export --planwrites Object names as the file name. It used to append anson the end. So the filename is nowAccount.jsonandFoo__c.jsoninstead ofAccounts.jsonandFoo__cs.json. Since the filenames are part of the plan file, this only affects newly generated plans/files. -
export betano longer writes empty child objects. Previously, you'd see properties with{records: []}that had no effect on imports. -
import betaignores theresolveRefsandsaveRefs(export betaproduces them to preserve compatibility with the non-beta import command). -
export betanow handles more than 2 levels of child objects in a query using--plan(up to 5 because that's SOQL's limit). see https://github.com/forcedotcom/cli/issues/2663 and https://github.com/forcedotcom/cli/discussions/2359 - both
export betaandimport betawith--planhandle records that refer to records of the same object type (ex: Account with ParentId, User with ManagerId). https://github.com/forcedotcom/cli/discussions/2364 -
import betausing--planhandles files with more than 200 records. It will batch them into groups of 200 per object. -
importsupported plan files where thefilesproperty could contain objects (the export command did not produce such files). Forimport betaonly strings are allowed and will throw an error otherwise. -
import betain--filesmode (not--plan) will import the files in parallel (files can't reference each other without--plan) -
importprovides deprecation warnings for bothcontent-typeandconfig-helpflags, sinceimport betaremoves them.--config-helpis now hidden (content-typewas already hidden) -
import betawith--planis optimized for references (using the saved ID of one record as the value of a Relationship Field in another) that follow the standard pattern@[ObjectName]Ref[SomeNumber], like@AccountRef54or@Foo__cRef0. In the past, a ref could start with@followed by anything. Theexportcommand historically produced refs in the preferred format (as doesexport beta), but you may have handcrafted your own at some point. Some of the enhancements (self-referential objects, support for more than 200 records in a file, etc) required the preferred pattern.
Export files created by export beta are compatible with import and import beta
The new record limit for import beta with --plan is not documented. You're most likely to hit a call stack depth (from recursion) or some org limit (data storage, api call limits) depending on your data and your org. If you're doing something really large, we still recommend the bulk commands.
During the beta, please submit issues with the new commands to https://github.com/forcedotcom/cli/issues
In general, you'll find the --plan options much more powerful. We encourage you to use those over the --files option.
Phase 2: GA the new commands, put the old under legacy. [July 10 2024] <=== Currently Here
- the old commands will be renamed to
data import legacy treeanddata export legacy tree, and markedhiddenanddeprecatedwith the Phase 3 date - the new commands will become
data import treeanddata export tree. They will still work with theirbetaalias, but you'll get a deprecation warning if you use it. - the
force:aliases will go to the new commands -
data export treewith--jsonwill being warning that it will change json output (the saveRefs/resolveRefs properties are in the json output) after Phase 3 date
Phase 3: retire the legacy commands and all their dependent code [Nov 10 2024]
- make
exportstop writing the unusedsaveRefsandresolveRefsproperties on plan files, and stop returning them in json - tighten schema to remove the
objectpart offiles, and removesaveRefsandresolveRefs - remove the
betaalias fromimport|export
Hello @mshanemc, Thank you for this new release! I particularly like to query more than 2 levels of child object, the import of more than 200 records and the possibility to refer to the same object type in a relation. Do you have any plan to support record type definition at import?
Hello @mshanemc, Thank you for this new release! I particularly like to query more than 2 levels of child object, the import of more than 200 records and the possibility to refer to the same object type in a relation. Do you have any plan to support record type definition at import?
Nobody's asked for that before. You can open a request for it https://github.com/forcedotcom/cli/discussions (that's what we use to prioritize what gets done next). It's a good feature idea but probably needs some design discussions.