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.) 😊 



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

25 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
  3. What a fantastic resource. Thank you so much!

    ReplyDelete
  4. hi awesome!!! thanks for sharing!!

    ReplyDelete
  5. Anonymous5/05/2021

    This is great! Thanks for sharing. To go a step further... is there a way to automate this backup like a scheduled task? That retrieve is right next to deploy. Do not want to click the wrong thing.

    ReplyDelete
  6. Anonymous5/06/2021

    can we take data(objects,fields and records) backup by this method?

    ReplyDelete
    Replies
    1. Hello,

      This method is use to take metadata backup and not used for data backup.

      There are different methods available for exporting the data from salesforce for example : Data Loader

      Delete
  7. We can't use wildcard with email template. Below piece won't retrieve email template.

    *
    EmailTemplate

    ReplyDelete
  8. This is great. How do you restore it? Or deploy it to a new org?

    ReplyDelete
    Replies
    1. 1. Authorise new org

      2. Right click on package.xml and deploy to the new org

      3. Done

      Delete
    2. Vinay S A2/17/2022

      can't able retrieve the all custom_objects it retrieved only 3/32from org

      Delete
  9. The AWS Certified Cloud Practitioner certification is one of the most popular certifications in cloud computing today. Cloud adoption is growing at an ever increasing rate and a shortage of skilled staff is driving up the value of cloud certifications. It’s important for personnel in many areas of the business to understand the cloud value proposition and how it can drive business value. if anyone wants to learn programming then you can also checkout these free AWS cloud practitioner courses

    ReplyDelete
  10. Very Helpful. Thank you
    Visit my blog https://webdesignvalley.com/

    ReplyDelete
  11. Do we get the flows/process-builders as well using this method ?

    ReplyDelete
    Replies
    1. Hey There,

      You can use below to get flows as well by just including below in your package.xml file :
      ====

      *
      Flow

      ====

      HAPPY LEARNING !! 🍻

      Delete
  12. Will this export custom feilds in standard objects?

    ReplyDelete
  13. Just out of interest will this override existing code in the new org?
    cheers

    ReplyDelete
    Replies
    1. Yes, if you deploy the extracted metadata it will update code in new org if the same metadata is deployed.

      Delete
  14. everything fine but email template cant fetch like this u mentioned in package.xml

    ReplyDelete
  15. When Actively removing germs and pollutants it can create a mesmerizing and serene effect. The sun's rays streaming in can cast beautiful patterns and shadows, creating a warm and inviting atmosphere within the space below. This natural illumination can bring a sense of openness, freshness, and connection with the outdoors

    ReplyDelete
  16. Thanks for sharing this information.
    Also You can try FileZIPO for backup and other useful operations in salesforce.

    ReplyDelete

HELP !! SHARE !! SUGGEST !!

Powered by Blogger.