Data Export Command Line
The FuseIT.G4S.DataExportConsole.exe application can be executed directly from the command prompt (via cmd window) or you can embed the command line in a script file.
The Data Export Command Line tool requires the .NET Framework 3.5 to be available.
Without it you may see a message like:
“This app can’t run on your PC
To find a version for your PC, check with the software publisher”
– Windows Server 2012 R2
You can see argument help if you use:
There are two ways to use the command line. By specifying the login details (1) or by supplying a connection string (2).
- Specifying Login Details
The following arguments are required:
com Partner API username
com Partner API password
com Partner API security token
Salesforce binding environment. Required to be one of the following:
- save path:
- File path where the exported zip files will be saved (enclose in “speech marks”, back slashes should be escaped)
An example command line might look like:
FuseIT.SFDC.DataExportConsole.exe /u:firstname.lastname@example.org /p:12345678 /t:C3P3qivIf5t6Q6uYtzxxxxxx /e:Production “C:\\SFDCexports”
- Supplying a Connection String
The connection string can be generated in the FuseIT SFDC Explorer, and then copied into the FuseIT.SFDC.DataExportConsole.exe.config (See Login Section). To add a connection string to the FuseIT.SFDC.DataExportConsole.exe, browse to the directory where the FuseIT.SFDC.DataExportConsole.exe was installed and open the FuseIT.SFDC.DataExportConsole.exe.config file. Find the element <connectionStrings> and insert your connection string within this tag.
An example connection string (without proxy authentication):
<add name=”testConnectionString” connectionString=”G4S:user email@example.com;password=test;token=Y3623283JAADJK7;enviroment=Production;” />
Additionally, if you are using the FuseIT.SFDC.DataExportConsole.exe through a proxy, the connection string would look like:
<add name=”testConnectionString” connectionString=”G4S:user firstname.lastname@example.org;password=test;token=Y3623283JAADJK7;environment=Production;proxyserver=192.168.132.123; proxyport=808;proxyusername=test; proxypassword=test!;proxyauthentication=PROPRIETARY; proxyssltype=ALWAYS” />
When using the FuseIT.SFDC.DataExportConsole.exe in the command line the following arguments are required:
connectionstringname: The name of the connection string – as specified in the SFDC.DataExportConsole.exe.config
- Save path
Server file path where the exported zip files will be saved (enclose in “speech marks”, back-slashes should be escaped)
An example command line using a connection string might look like:
FuseIT.SFDC.DataExportConsole.exe /c:testConnectionString “C:\\SFDCexports”
See additional configuration options in FuseIT SFDC Data Exporter – AppSettings
Automated Data Export retrieval
Once the command line tool is configured you can automate the process by scheduling a task in Windows to invoke it at the required date and time.
- bufferSize – The download buffer size (in kilobytes). Defaults to 16 kilobytes. Reducing may help avoid timeout issues. Increasing can improve download speed.
|<!–Set the download block size. Default set to 16k bytes –>
<add key=”bufferSize” value=”16″/>
- maxRetry – How many times to retry a download that is failing. Defaults to 3.
|<!–Set the maximum retry value.
If the maxRetry value is 0 the download operation will be tried only once.
Default value is set to 3 –>
<add key=”maxRetry” value=”3″/>
Auto-Downloading Salesforce Backups & Metadata
Salesforce can automatically generate full data backups on a weekly or monthly basis. Once created the requesting user receives an email that the files are ready and will be downloadable for 48 hours, after which they’re deleted.
The solution described below automates the download process so you can set and forget both parts – the backup and download of the export files.
It also makes a copy of your org’s metadata (configuration) for safe keeping.
Note: I recommend scheduling the downloads to run at 24 hours after the time scheduled in Salesforce to ensure the data is ready since they don’t always happen immediately
- Schedule data exports in Salesforce
- Setup your Windows environment which will be running the backups
- Install FuseIT SFDC Explorer (docs)
- Install com CLI (docs)
- Create a Windows PowerShellscript based on the template below
- Schedule the PowerShellscript to run, ideally more than 12 hours after the Salesforce data export