To deploy your changes to salesforce from One Org to another Org using SFDX CLI, follow the below step by step guide.
Step 1: Open your terminal and Sign In to SFDX CLI using the below command. This command will open the web page and ask you to log in using salesforce credentials.
sfdx auth:web:login --setdefaultdevhubusername --setalias my-dev-org
Step 2: Create package.xml to retrieve your metadata that we will deploy into another org. Here, I am trying to deploy my TCRM dashboard so adding relevant information to my package.xml for the same.
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>MY_First_Dashboard</members> <name>WaveDashboard</name> </types> <version>53.0</version> </Package>
Step 3: Run the below command to retrieve the metadata. It will download the unpackaged.zip file in your current directory.
sfdx force:mdapi:retrieve -k package.xml -r . -u [email protected]
Step 4: Deploy this retrieved meta into target org using the below command.
sfdx force:mdapi:deploy -f unpackaged.zip --verbose -u [email protected]
You should be able to see your changes in the target org. If you face no package.xml found issue in this step, you can find the solution here.
Happy Coding !!
Leave a Reply