Posts

Showing posts with the label Data export service

Automate data backup of Salesforce org

Image
Salesforce provides a feature called "Data Export Service" through which you can generate backup files of data on a weekly or monthly basis depending on your salesforce edition. You can export all your org’s data into a set of comma-separated values (CSV) files. The sad part over here is that this feature in not supported in Sandbox yet. Developers frequently have the requirement to take the data backup of sandbox org, especially if they are working with a managed package.  Here is a batch class which will allow you to take a backup of your entire org data and store it under Notes and Attachment under a custom Backup object. In the next blog, I will enhance this code to store the backup in Google Drive instead of storing it in a custom object in org. Here are the steps you need to take to make this work : 1) Create a custom object in your org whose API name should be  Backup__c 2) Create below batch class in your org global class DataExportBatch