How To Take Complete Salesforce Org Backup With VS Code

How To Take Complete Salesforce Org Backup With VS Code

Salesforce Org Backup With VS Code

Hey there !! I hope you are doing great. In today's post, we will be talking about how to take complete salesforce org backup with VS Code IDE.

As a developer whenever we want to make any changes in the code or process builder, workflow etc. we need to have an old backup before making any changes.

It's very frustrating sometimes right? because copypasting and maintaining those separate files is quite time-consuming. Hence we want something which can easily do this work. Although there are multiple ways to do this with the other tool, in this blog we will be discussing it with the help of the VS Code.

So let's get started.....

Please follow the below steps :

STEP 1 : 
- Install VS Code from the there official website.
- Just like any other IDE complete the installation setup.
- Make sure to Install Salesforce CLI Extension from the extension section
- Restart your VS Code Once.

STEP 2 :
- Now Press Ctrl+Shift+P  (Windows) or Command+Shift+P (Mac)
- Then type SFDX: Create project with manifest

How To Take Complete Salesforce Org Backup With VS Code

STEP 3 :
- Then Select Standard on the next screen

How To Take Complete Salesforce Org Backup With VS Code

STEP 4 :
- Give your project folder a name whatever you want 

How To Take Complete Salesforce Org Backup With VS Code

STEP 5 :
- Once the folder is created again press Ctrl+Shift+P  (Windows) or Command+Shift+P (Mac).
- Then type SFDX: Authorize an Org and hit enter.

How To Take Complete Salesforce Org Backup With VS Code

STEP 6 :
- Now Select Production, Sandbox based on your requirement.
- Now give some alias (short name) and hit enter.

How To Take Complete Salesforce Org Backup With VS Code

STEP 7 :
- Now it will redirect you to your browser.
- Enter your credentials and login. Once you're done go back to VS Code.
- You will see a message like this that Authorize an Org Successfully ran.

How To Take Complete Salesforce Org Backup With VS Code

STEP 8 :
- From left side folder hierarchy click on Manifest.

How To Take Complete Salesforce Org Backup With VS Code

STEP 9 :
- Then Click on package.xml file.
- Now replace the code inside package.xml with the following code to get complete salesforce org backup

------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ActionLinkGroupTemplate</name>
</types>
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>AppMenu</name>
</types>
<types>
<members>*</members>
<name>ApprovalProcess</name>
</types>
<types>
<members>*</members>
<name>AssignmentRules</name>
</types>
<types>
<members>*</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
<members>*</members>
<name>AuthProvider</name>
</types>
<types>
<members>*</members>
<name>AutoResponseRules</name>
</types>
<types>
<members>*</members>
<name>BrandingSet</name>
</types>
<types>
<members>*</members>
<name>CallCenter</name>
</types>
<types>
<members>*</members>
<name>Certificate</name>
</types>
<types>
<members>*</members>
<name>CleanDataService</name>
</types>
<types>
<members>*</members>
<name>Community</name>
</types>
<types>
<members>*</members>
<name>ConnectedApp</name>
</types>
<types>
<members>*</members>
<name>ContentAsset</name>
</types>
<types>
<members>*</members>
<name>CorsWhitelistOrigin</name>
</types>
<types>
<members>*</members>
<name>CustomApplication</name>
</types>
<types>
<members>*</members>
<name>CustomApplicationComponent</name>
</types>
<types>
<members>*</members>
<name>CustomFeedFilter</name>
</types>
<types>
<members>*</members>
<name>CustomHelpMenuSection</name>
</types>
<types>
<members>*</members>
<name>CustomLabels</name>
</types>
<types>
<members>*</members>
<name>CustomMetadata</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>CustomObjectTranslation</name>
</types>
<types>
<members>*</members>
<name>CustomPageWebLink</name>
</types>
<types>
<members>*</members>
<name>CustomPermission</name>
</types>
<types>
<members>*</members>
<name>CustomSite</name>
</types>
<types>
<members>*</members>
<name>CustomTab</name>
</types>
<types>
<members>*</members>
<name>Dashboard</name>
</types>
<types>
<members>*</members>
<name>DataCategoryGroup</name>
</types>
<types>
<members>*</members>
<name>DelegateGroup</name>
</types>
<types>
<members>*</members>
<name>Document</name>
</types>
<types>
<members>*</members>
<name>DuplicateRule</name>
</types>
<types>
<members>*</members>
<name>EclairGeoData</name>
</types>
<types>
<members>*</members>
<name>EmailServicesFunction</name>
</types>
<types>
<members>*</members>
<name>EmailTemplate</name>
</types>
<types>
<members>*</members>
<name>EscalationRules</name>
</types>
<types>
<members>*</members>
<name>ExternalDataSource</name>
</types>
<types>
<members>*</members>
<name>ExternalServiceRegistration</name>
</types>
<types>
<members>*</members>
<name>FlexiPage</name>
</types>
<types>
<members>*</members>
<name>Flow</name>
</types>
<types>
<members>*</members>
<name>FlowCategory</name>
</types>
<types>
<members>*</members>
<name>FlowDefinition</name>
</types>
<types>
<members>*</members>
<name>GlobalValueSet</name>
</types>
<types>
<members>*</members>
<name>GlobalValueSetTranslation</name>
</types>
<types>
<members>*</members>
<name>HomePageComponent</name>
</types>
<types>
<members>*</members>
<name>HomePageLayout</name>
</types>
<types>
<members>*</members>
<name>InstalledPackage</name>
</types>
<types>
<members>*</members>
<name>Layout</name>
</types>
<types>
<members>*</members>
<name>Letterhead</name>
</types>
<types>
<members>*</members>
<name>LightningBolt</name>
</types>
<types>
<members>*</members>
<name>LightningComponentBundle</name>
</types>
<types>
<members>*</members>
<name>LightningExperienceTheme</name>
</types>
<types>
<members>*</members>
<name>MatchingRules</name>
</types>
<types>
<members>*</members>
<name>NamedCredential</name>
</types>
<types>
<members>*</members>
<name>NetworkBranding</name>
</types>
<types>
<members>*</members>
<name>PathAssistant</name>
</types>
<types>
<members>*</members>
<name>PermissionSet</name>
</types>
<types>
<members>*</members>
<name>PlatformCachePartition</name>
</types>
<types>
<members>*</members>
<name>PostTemplate</name>
</types>
<types>
<members>*</members>
<name>Profile</name>
</types>
<types>
<members>*</members>
<name>ProfileSessionSetting</name>
</types>
<types>
<members>*</members>
<name>Queue</name>
</types>
<types>
<members>*</members>
<name>QuickAction</name>
</types>
<types>
<members>*</members>
<name>RecommendationStrategy</name>
</types>
<types>
<members>*</members>
<name>RecordActionDeployment</name>
</types>
<types>
<members>*</members>
<name>RemoteSiteSetting</name>
</types>
<types>
<members>*</members>
<name>ReportType</name>
</types>
<types>
<members>*</members>
<name>Role</name>
</types>
<types>
<members>*</members>
<name>SamlSsoConfig</name>
</types>
<types>
<members>*</members>
<name>Scontrol</name>
</types>
<types>
<members>*</members>
<name>Settings</name>
</types>
<types>
<members>*</members>
<name>SharingRules</name>
</types>
<types>
<members>*</members>
<name>SiteDotCom</name>
</types>
<types>
<members>*</members>
<name>StandardValueSetTranslation</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<types>
<members>*</members>
<name>SynonymDictionary</name>
</types>
<types>
<members>*</members>
<name>TopicsForObjects</name>
</types>
<types>
<members>*</members>
<name>TransactionSecurityPolicy</name>
</types>
<types>
<members>*</members>
<name>Workflow</name>
</types>
<version>46.0</version>
</Package>
------------------------------------------------------------

STEP 10 :
- Now right click on package.xml file and click on SFDX: Retrieve Source in Manifest From Org 

How To Take Complete Salesforce Org Backup With VS Code

- Then It will start retrieving all your data from your salesforce org.
- It will take time based on the data in your org (sometimes internet speed as well 😉)

Once you will get success message you can click on force-app and under that folder you will see all your backup files in the respective type of folder.

How To Take Complete Salesforce Org Backup With VS Code

And finally, we have everything that you need in your backup.

In this above process, the most important file is package.xml file which actually fetches all your metadata from your salesforce org.

Cheers 🍻!!

WOHOOO !! YOU HAVE JUST COMPLETED COMPLETE SALESFORCE ORG BACKUP WITH VS CODE EPISODE
If you like this salesforcekid learning platform please let me know in the Comment section...Also, Share with your salesforce folks wish you all
Happy Learning ☁️⚡️ (Learn. Help. Share.) 😊 

saleforcekid by Ajinkya Dhas On Play Store
How To Take Complete Salesforce Org Backup With VS Code How To Take Complete Salesforce Org Backup With VS Code Reviewed by on Rating: 5

5 comments:

  1. Hi fantastic post bro.. I have a question if retrive once more it will override my data right??
    Example: yesterday i took up backup and today also ...what type of approach I have to follow??

    ReplyDelete
    Replies
    1. Hey !! Glad that you it helps you 😊.

      To answer your query :
      Yes, It will overrride with the new. But What you can do if you want both of them.

      For example fo daily backup you will create new project with manifest and create separate folder each day to retrive the data. everything else will remain same.

      I hope this will help 😊

      Delete
  2. Ajinkya, It helps lot. Can we add last 2 missing line. It will helpful for new people.

    46.0

    ReplyDelete
    Replies
    1. Thanks for your observation. I have updated that in package.xml file. 😊

      Delete

HELP !! SHARE !! SUGGEST !!

Powered by Blogger.