Various SFDX cli / bash scripts for interacting with Salesforce data or metadata
If you need to determine what metadata is found in one org but not in another, you may use this script. This does not, however, inform differences in the contents of those metadata. The code --diff method performs a text based diff and does not depend on git commit history, branches nor states. This is helpful when working on orgs regardless if org-based or git-based deployment strategy.
In order to compare differences in those metadata, each specific metadata will need to be retrieved with another cli call project retrieve start. This can be done, but with the 10,000 metadata item limit of a retrieve in Salesforce, you will need to break this up into chunks of metadata types if the retreived metadata is too large. I.e. Retreive all custom objects. Then retrieve all APEX classes. If you do not need custom packages, avoid namespaced metadata, except for those you may extend and augment, such as managed package picklists.
https://help.salesforce.com/s/articleView?id=platform.devops_center_setup_seed_repo_generate_manifest.htm&type=5 https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_retrieve_use_retrieve.htm https://sfdx-hardis.cloudity.com/hardis/org/monitor/backup/
- Have SF installed on VS Code https://help.salesforce.com/s/articleView?id=ind.tpm_admin_task_deploy_source_code_using_sfdx.htm&type=5
- Authenticate and set alias for your connected orgs
sf project generate manifest --output-dir manifest --name=allMetadata-dev --from-org dev
sf project generate manifest --output-dir manifest --name=allMetadata-test --from-org test
sf project generate manifest --output-dir manifest --name=allMetadata-prod --from-org prod
# VS Code will present side x side the differences, highlighting added or missing metadata between the two org manifests as "existence checks"
code --diff ./manifest/allMetadata-dev.xml ./manifest/allMetadata-test.xml