+ Start a Discussion
Neel NeelNeel Neel 

Approach to Backup Metadata to folder

Friends,

We are looking for best way to take backup of Metadata (Changes to Std obj, Custom objects, Apex code, Profiles, etc).

We heard about below options:
1) Force.com IDE on Eclipse
2) Force.com ANT Migration Tool
3) Snapshot (not sure if this is paid)
4) Change Sets

What is standard approach to take backup to a folder on drive? We are looking for something where we can restore a specific object if need be.

Will we require to go for GITHUB along with one of the above 4 options.

Appreciate if someone can share from their experience and provide details on this.

Cheers,
Best Answer chosen by Neel Neel
Alba RivasAlba Rivas
You can connect a MavensMate project with your org. You can select which metadata you want mavensmate to download for the first time. If you want a full backup, select every kind of metadata. In this way, the code in your drive and the code in your org will be synchronized. You can do exactly the same exactly with Force.com Eclipse plugin. Moreover, with these two tools, as you have your eclipse / mavensmate project synchronized with your org, you can write code directly in eclipse / sublime, and when you save the file, it's directly saved in your org.

Regarding the version control, you have to manage it separately, as Salesforce does not provide it by the moment. I recommend you, once you have downloaded your code with any of the tools we mentioned, to upload them to git (or any other version control system) for tracking your changes. You will be in charge of uploading your changes to your git repository at any time. 

Either if you decide to develop in your mavensmate/eclipse project folder, or if you decide to develop in your org and download your changes, if you use your drive folder as git local folder, any change that you made to your code will be seen in your git client.

On the other hand, if you want to restore an old version of a file, revert it from git, and use mavensmate / eclipse to upload it.

You can use Force.com ant migration tool to deploy/retrieve code from your drive to/from an org as well, but for developing I personnally prefer the tools I have mentioned as they provide you a much better way to develop and tracking changes. Changesets are used to send metadata changes from one org to another, rather than to/from your drive.

Hope it helps!




 

All Answers

Alba RivasAlba Rivas
Hi,

I will suggest two more approachs for retrieving metadata:

- Workbench: you can retrieve metadata via web through workbench, I have used it sometimes (https://workbench.developerforce.com/).
- MavensMate: Force.com plugin for Sublime which can use Salesforce's APIs to retrieve metadata as well (http://mavensmate.com/).

Could you tell me how is your programming environment? Where do you write your code and perform your customizations? Do you use a development environment or do you have a sandbox?

Regards


 
Neel NeelNeel Neel
Thanks Alba. We are using Sandbox.

Can MavensMate be used to take full backup as well?

Also, if you could share what is easiest way or recommended way to take full backup? Something easier to restore a Apex Class, if we see issues later.

Thanks,
Alba RivasAlba Rivas
You can connect a MavensMate project with your org. You can select which metadata you want mavensmate to download for the first time. If you want a full backup, select every kind of metadata. In this way, the code in your drive and the code in your org will be synchronized. You can do exactly the same exactly with Force.com Eclipse plugin. Moreover, with these two tools, as you have your eclipse / mavensmate project synchronized with your org, you can write code directly in eclipse / sublime, and when you save the file, it's directly saved in your org.

Regarding the version control, you have to manage it separately, as Salesforce does not provide it by the moment. I recommend you, once you have downloaded your code with any of the tools we mentioned, to upload them to git (or any other version control system) for tracking your changes. You will be in charge of uploading your changes to your git repository at any time. 

Either if you decide to develop in your mavensmate/eclipse project folder, or if you decide to develop in your org and download your changes, if you use your drive folder as git local folder, any change that you made to your code will be seen in your git client.

On the other hand, if you want to restore an old version of a file, revert it from git, and use mavensmate / eclipse to upload it.

You can use Force.com ant migration tool to deploy/retrieve code from your drive to/from an org as well, but for developing I personnally prefer the tools I have mentioned as they provide you a much better way to develop and tracking changes. Changesets are used to send metadata changes from one org to another, rather than to/from your drive.

Hope it helps!




 
This was selected as the best answer
Neel NeelNeel Neel
Thanks a lot Alba. A very detailed asnwer, it helps us a lot to get clarity.

Best Regards,