Posts

Showing posts from September, 2020

LinkedIn

An Easy approach to Take Metadata Backup of your Org - Using sfdx mdapi and powershell script

Image
 Most of the time, taking metadata back up of your org involves lots of manual effort or usage of some third-party tools. So I would like to share a comparatively simple approach that involves less manual effort.   This is using the power of sfdx metadata api commands along with PowerShell script.  Prerequisite  Install and set up Salesforce CLI Follow the below link to install Salesforce CLI https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm  Script Logic Script Logic involves below high-level activities Let us see this in detail. First, we can create a file and save it as  downloadcompfinal.ps1 1. Connect to your Org You need to establish a connection to the Org from which you need to retrieve metadata. For that we can use the below command in your script file: sfdx force : auth : web : login -- setalias <your alias name>demoorg This will open a login window and you can provide credentials of the org that you want to connect.