SalesforceOrgBackUp

This repo contains the node.js script for retrieving the entire metadata(supported by Metadata API) from Salesforce org ( the org should be configured/Authorized in SFDX already).

Sample usecase:
This can be helpful for taking backup of entire ORG. One Sample Use Case will be taking ORG backup during sandbox refresh process so that we do not lose any data accidentally.

This is testing . please ignore

Technical Design
The code works completely based on the native sfdx commands integrated with node.js via Shelljs(npm module).

Commit Latest Version

How to Retrieve Metadata for the entire ORG ??

  1. Download/Clone the git repo.
  2. Navigate to the downloaded folder from terminal/command prompt. (cd directoryurl)
  3. Run the command npm install --save. This will install the npm modules.
  4. run the below command and follow the steps. node index.js

After running the above command , the below question will be displayed. Press Y and enter.
Do you want to Retrieve the full backup of Org??(Y/N) : Y
Please enter the SFDX Configured UserName for Full backup : sampletest@test.com.org ( Please note, this username should already be configured in sfdx )

After entering the username , the Metadata Retrieval will start.

This will take time based on the total amount of metadata present in the org.

After all the metadata retrieval is completed , we will be able to find the metadata inside of folder RetrievedFiles in the same directory.

How to Search for a String in the downloaded Metadata ??
Please note , the Search functionality will only be applicable after the metadata is downloaded

Do you want to Retrieve the full backup of Org??(Y/N) : N
Please enter the text to search.(Please note this string will be searched on the retrieved metadata. If you do not have metadata downloaded already , please cancel by pressing enter and download metadata from step1 : Demo (Please enter the string to be searched here )

This will start searching for the given keyword in the downloaded metadata files and generate a csv report with the search results. The csv report can be found inside of the folder Search Results.