function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dellseysdellseys 

How to Automate backup process to download backup file

I am able to manully schedule a backup in salesforce. When the backup is ready, salesforce sends a link and a mail to inform me that the backup is ready. Hence, I would have to follow the link to download the backup to my own storage area. 

Is it possible to automate the process where by I don't have to manully download the backup file when it is ready but to automate this process?

Please any guide to give me a headstart? what do i look for what do i use?

Thank you
Steve
jigarshahjigarshah
Stephen,

There are a couple of ways to achieve this.

1. Using standard Reports that are scheduled to run and sent to the respective Users where the report is sent as an email attachment. You could then have an email parser written to parse the attachment and then save its contents to the respective location.

2. You could use the Command Line Interface (https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/using_the_command_line_interface.htm) provided by the Apex Data Loader to automatically download the respective records based on the specified filter criteria within the query on a respective server. You can execute the CLI by creating a windows batch (.bat) file and then scheduling that batch file to run through a windows task scheduler.

3.Build a Scheduled Batch Job in Apex to execute every night and write the specified Sobject records to an external service or a backup location such as Amazon Simple Sotrage Service etc.

4. If you don't want to go through developign a custom solution you could leverage available ETL (Extract, Transform and Load) Tools such as Infromatica, Talend, DB Sync etc. to run daily scheduled jobs that backup data to the target location which could be a database, external service, FTP or a cloud based external service.

Please do not forget to mark this thread as SOLVED and answer as the BEST ANSWER if this answer helps address your issue.
Frédéric ProvotFrédéric Provot
Hello Stephen and jigarshah,

I have the same issue, and wonder which Salesforce objects can be requested to get the links to the files, or the files themselves.
You mention that it's possible to "download the respective records based on the specified filter criteria", but I think you're speaking about how to export ourself the data, not how to get the zip files, am I right? 

The question is to get the generated zip file easily. So what object can be queried by REST API to get zip file links or content?

Regards 
Frederic
jigarshahjigarshah
Frederic,

If you are referring to the standard Data Export feature and are trying to access the zip file generated as a part of that, then this is not something which is possible through Apex or programmaticaly. The reason why this is not available is probably to secure your business data from unautorized scripts. In fact as a part of the doucmentation 

In case you need to use a scheduled export that occurs at a defined time period, use the Command Line Interface offered by the Apex Data Loader. Refer the following link to get a detailed perspective on how this can be accomplished. (https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/using_the_command_line_interface.htm).

One important thing to note here is that data will be filtered based on the Soql Query that you specify for the sfdc.extractionSOQL property within the process-conf.xml bean.

Note: Nested queries and queries on Attachments are not supported via the CLI.
jigarshahjigarshah
This blog could be of help - http://rar4u2.blogspot.ie/2012/01/scripted-data-loader.html
Rajan Kumar 62Rajan Kumar 62
Gmail Email Backup Tool (https://www.mailconvertertools.com/gmail-email-backup/) provides an automated interface to back up the Gmail Emails. Backup Gmail account mailbox in various file formats such as AOL, OST, DOCM, TXT, PNG, TIFF, DOCX, GIF, JPEG. One can utilize the utility to store their Gmail messages in file extension according to preference. Moreover, one can open a suitable file format on the Windows platform smoothly.