Instead of using the Weekly Export function and updating this data into Salesforce Libraries on a periodic basis as best practice to store historical Salesforce data, I would like to explore exporting Salesforce into .sqlite files, which I could then use in DB Browser.

The benefit here is that is that this would be a more intriguing way to display related historical data, which could be filtered via SQL easily. For example, if I wanted to generate a list of all Opportunity records and corresponding contacts from the past, I would have to open up multiple .csv files from the Weekly Export .zip and then do the necessary Excel manipulation to filter on the subset which I cared about.

What is the best way that I can export Salesforce data from required Salesforce objects into a .sqlite file?

  • 1
    doing a csv import straight into a sqlite table is pretty straightforward, but I would be concerned if it is the right db to stuff salesforce data into, not knowing the size, number of columns, what your data looks like.. – curtisk Nov 16 '16 at 21:46
  • Do you have any recommendations about other db's worth looking at for this instead of sqlite? Thanks – Andy Hitchings Nov 16 '16 at 23:23

So traditionally and cheaply and fully automated...I'd go DataLoader running on a vm or even a machine with windows scheduler kickit it off. Look up DataLoader command line, you can automate it to extract to a csv you can also customise the query so that the csv only contains the opportunities of interest. https://developer.salesforce.com/page/Using_Data_Loader_from_the_command_line the same bat file can then run a zip for your sqllite db to consume on a regular basis.

  • Let's say I have 6 exports that represent 6 months of historical data, and I want to query a subset from each of those exports, would the Data Loader CLI really be used for that? I just want to say 'hey, x months ago, here was the data, and here are the related objects' all from either a SOQL or SQL, and here were their properties. I don't think CLI can do that? With DB Sql I can see the schema so easily. Whereas with CLI and any combo of .csv files, you won't see that entire schema. – Andy Hitchings Nov 17 '16 at 8:45
  • That's correct. I think you need to review the exact requirement, if you're trying to do snapshot management, the export is probably not the way to do this. You'll really struggle to get the snapshot at point in time out of salesforce. I'm not even sure how you'd reliably export the correct data (created date is unreliable as e.g. quantity may have been overwritten after the fact) I was thinking you were trying to get regular exports as a backup, from which to drive other data and restricting records for security reasons – Nonick Nov 18 '16 at 2:22

Use Data Export option from Sales force. Go to Data Management under Setup, then click on Export Now button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.