Source Salesforce #
The extracted replicant-cli
will be referred to as the $REPLICANT_HOME
directory in the proceeding steps.
I. Add Replicant to Salesforce as a Connected App #
Before you can use Replicant with Salesforce, you have to add it to Salesforce as a Connected App. To do so, follow the steps below:
-
From Salesforce browser UI, navigate to Setup > App Manager.
-
Click New Connected App at the top right corner.
-
Create a new Connected App by going through the following steps:
a. In the Basic Information section, fill in the following fields:
- Connected App Name
- API Name
- Contact Email
- Logo Image URL (optional)
- Info URL (optional, use https://www.blitzz.io/)
b. In API (Enable OAuth Settings) section, do the following:
- Select the Enable OAuth Settings checkbox.
- Select the Enable for Device Flow checkbox.
- From the Selected OAuth Scopes list, add Access and manage your data (api).
- Select the Require Secret for Web Server Flow checkbox.
c. Click Save.
-
When the app becomes available in the App Manager window:
a. From the drop-down menu of the app, select View.
b. In the new window, you’ll find your Consumer Key and Consumer Secret values. These values correspond to the the values of the
client-id
andclient-secret
parameters of the Salesforce connection configuration respectively. To know more about the Salesforce connection configuration, go to the next section Setting up Connection Configuration.
II. Set up Connection Configuration #
-
From
$REPLICANT_HOME
, navigate to the sample connection configuration file:vi conf/conn/salesforce.yaml
-
You can store your connection credentials in a secrets management service and tell Replicant to retrieve the credentials. For more information, see Secrets management.
Otherwise, you can put your credentials like usernames and passwords in plain form like the sample below:
type: SALESFORCE username: 'username' password: 'password' security-token: 'security token' api-version: 'api version' client-id: 'client id' client-secret: 'client secret' # Use to specify total wait time when querying data from server. Below listed numbers are the default #max-retries: 20 #retry-wait-duration-ms: 10_000 # Use to specify number of retries and time to wait between retries in case of connection timeouts before throwing exception. Below listed numbers are the default #max-conn-retries: 20 #conn-retry-wait-duration-ms: 10_000
III. Set up Extractor Configuration #
-
From
$REPLICANT_HOME
, navigate to the applier configuration file:vi conf/src/salesforce.yaml
-
Make the necessary changes as follows:
snapshot: threads: 16 # fetch-size-rows: 250_000 # Add specific config if needed for any of the tables that are to be replicated. Example sets Account table to be replicated with 10 jobs using LastModifiedDate column to split the data between jobs. per-table-config: - tables: Account: split-key: "LastModifiedDate" num-jobs: 10 realtime: # threads: 1
For a detailed explanation of configuration parameters in the extractor file, read Extractor Reference.