As we know, backup solutions for Salesforce are incredibly expensive. At the same time, the built-in Salesforce data export is irritating and not really a working solution. When you start an export using the Salesforce tool, the download links expire within 48 hours, and the interface doesn’t allow you to download them all at once. This forces people to click on each download one by one and wait for hours, only to end up with a download that might not even complete successfully. All this makes data export an incredibly irritating process, and it seems that Salesforce has no plans to fix it, as they haven’t done so for years.
Fortunately, there is an easy-to-implement alternative using AWS solutions.
Automatic Salesforce data export with AWS AppFlow and S3
To address the problem above, I created a quick automation using Amazon’s AppFlow product. In short, it allows you to integrate Salesforce (or other SaaS products) and securely transfer data between Salesforce and AWS.
The connection is really straightforward, and once you set it up, you can tell AppFlow which Salesforce objects you want to transfer to AWS. In the next configuration step, you tell AppFlow to store your data in a private S3 bucket, obviously following strict security measures.
All these steps are done through a convenient UI, and it doesn’t take long before your data starts flowing into S3.
As an additional benefit, you can use the S3 Parquet file format, which stores data much more efficiently than CSV. The storage space required can be 3 to 10 times smaller than that of standard CSV files exported by Salesforce Data Export.
Another side benefit of this solution is that you can later query your Parquet data directly from S3 using Amazon Athena. In case you ever need such a perk…
Pricing
For a couple of GB, e.g. 10 GB, I expect the bill to be a couple of dollars per month. This can be further improved by using AWS Glacier for old backups. Glacier is another AWS solution that allows you to store files that you rarely need. They take longer to retrieve but are cheaper to store.
You should also know that AWS AppFlow charges based on the number of flows. For example, if you have 100 Salesforce objects, you will need to set up 100 flows to sync them automatically. This is an automated process, so don’t worry about having to click through all of them manually.
Considerations
1. Security: Obviously, the main consideration when building this is security. You don’t want your data exposed somewhere on the internet, sitting in a CSV file, as even Fortune 500 companies have made this mistake in the past. Therefore, you should implement all the security measures required by AWS and S3.
2. Flow Connections: When you set up the connection from AppFlow to Salesforce, you essentially tell AppFlow which objects to subscribe to and start syncing to S3. The inconvenience here is that any new custom fields you add to the objects will not appear automatically in AppFlow, so you should build additional automation to handle this.
3. Using the data: Restoring or using the data is no different from working with the old-school CSV data export provided by Salesforce, which allows you to download CSV files. Essentially, the Parquet files can easily be converted into CSV files, which you can download and use just like the files exported directly from Salesforce.