3

I am playing around with the force:org:clone command(which is in BETA) but can't get it to work.

Here's the command I put together: sfdx force:org:clone -u [email protected] -a FULL_CLONE -t sandbox

The error I get is: To indicate which sandbox org you want to clone, specify SourceSandboxName in a definition file or as a command line argument.

I looked at all the arguments that are listed for the command and don't see anything related to SourceSandboxName. Isn't the username making it clear enough which sandbox I am trying to clone?

In addition it appears that the documentation is incorrect, if you take a look at their example its referencing sfdx force:org:create.

Here's a link to the documentation: https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_org.htm

2 Answers 2

7

We got an answer on social media:

The docs for the sandbox operations and the help topic fixes are scheduled to be published today. -u needs to point to the org with sandbox licenses ie the prod org. SourceSandboxName is a field in the definition file, not the command and should reference sandbox being cloned.

The appropriate command will look like this:

sfdx force:org:clone -f config/cloned-sandbox.json -u prod-org -t sandbox

The docs should reflect this soon.

3
  • Thanks for following up on this.
    – Arthlete
    Commented Jun 12, 2019 at 21:39
  • What values we should have in the cloned-sandbox.json file, like key=value pair @sfdcfox Commented May 27, 2020 at 16:18
  • 1
    @YaswanthTikkisetti It's a JSON file, so something like { "SourceSandboxName": "sbname" } You can also just use SourceSandboxName=sbname on the command line.
    – sfdcfox
    Commented May 27, 2020 at 16:36
0

Hello below is a command used to clone a developer org. I will explain each parameter.

sfdx force:org:clone -t sandbox SandboxName=DevSbx1 SourceSandboxName=jnbanksan -u prod -a MyDevSandbox
  1. -t specifies its a sandbox to be created
  2. SandboxName - is the actual JSON field name in the definition field schema, which denotes your sandbox name.
  3. -u is the authenticated prod instance,
  4. -a is the alias to reference this newly created sandbox
  5. SourceSandboxName is the actual existing org name you wish to clone not the org alias.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .