+ Start a Discussion
Amiya Das1410Amiya Das1410 

How to take backup of salesforce org with VS Code?

I want to take backup of my newly refreshed sandbox org. While doing so via MavensMate, it is showing oAuth error like below. 
Is this the issue for all newly created/refreshed orgs ??. 
If yes, I want to know how to take backup of org via vs code directly without mavens.
Thanks in advance.User-added image
Raj VakatiRaj Vakati
Here is the best link to refer 




Amiya Das1410Amiya Das1410
Thanks a lot.
Ajay K DubediAjay K Dubedi
Hi Amiya,

Really I don't know Is this the issue for all newly created/refreshed Org or related to your connectivity but
Yes if you can take a backup of org via vs code directly without mavens you can take to follow these simple steps :

After the Installation of VS Code, you have to install two packages in your VS code for support Salesforce
you can get it on click VS code in extension: Marketplace than insert the search box salesforce and install these two packages

1. Salesforce CLI Integration (https://developer.salesforce.com/tools/sfdxcli)
2. Salesforce extension

When you created first time a folder in VS code than you have followed these step with the command(ctrl+shift+p)
- Create a project with Manifest
- Authorize an Org (on click this you will give access your Production org or Sandbox, its depend on you who you want give to vs code)
- Retrieve Source in Manifest from Org (Here you can take a backup)

Then you can get your Org data in your VS code folder and when you will reopen this Without having to re-authenticate it each time.
If you change anything in your org then you can retrieve your data through a manifest(On click on manifest there are a package.xml file,
open package.xml and then on right click you can retrieve your data).

For more information refer: https://www.youtube.com/watch?v=7qR0c8h5cCU

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Ajay Dubedi
Vignaesh Ram AmarnathVignaesh Ram Amarnath
I guess it is proxy error. Are you doing this in office network?
Rahul Jain 199Rahul Jain 199

I have retrieved the data to VScode and do some change and deleted some fields then I'm retrieving the data in the same VS project but the problem is not updating the deleted one.
Means I have deleted some fields in salesforce and then retrieve the data but it not delete from VSProject.
Any suggestion???

Apart from the articles shared by @Raj Vakati above,

- You can create a SFDX manifest based project
- Use this VS Code extension to generate the package.xml manifest file.
- Retrieve the metadata

Generate Metadata Extension
Ajith Reddy 7Ajith Reddy 7
Very Helpful. Thank you
Dave MeixnerDave Meixner
It doesn't backup your data, but if you are looking to backup sourcecode and meta data, the Welkin Suite will let you make a project, connect to an org/sandbox, and then bring down a huge amount of sourcecode and metadata to your project's folder structure.  Which you can then work with in Welkin, VS Code or any other editor.

A Welkin's Project with all the metadata options checked on:
When you select everything downloadable for a Welkin's project.

Dave MeixnerDave Meixner
Of course you can do the same thing inside of VS Code with the DX extensions installed.   You can create a empty DX Project.  The Org Browser will let you download an entire type of metadata (i.e. Apex Classes, App Menues, Approval Processes, etc) with just a click for each type.  Less automated and slower then the Welkin Suite, but free.

SFDX Extention's Org Browser: Metadata
User-added image