How to Set Up Daily Backup of Salesforce Contacts to Dropbox

In this tutorial, we will show how to configure a daily backup of Salesforce contacts to Dropbox. The tutorial can actually be applied for backing up any Salesforce objects.

Creating Connections

In order to export data from Salesforce to a file uploaded to Dropbox, first we need to create connections to Salesforce and Dropbox. If you have already created the necessary connections, you may skip these steps. To create a connection to Salesforce, perform the following steps:

  1. Click +NEW in the top menu.
  2. Click the Connection button in the menu on the left.
  3. In the opened Select Connector page, select Salesforce. To quickly find it, you can either use the Type to filter box or filter connectors by categories using the All list (for Salesforce, select the CRM category).
  4. The default name of new connection is Untitled. Just click it to rename the connection, for example, to Salesforce1.
  5. From the Environment drop-down list, select the environment type of Salesforce to export data from.
  6. From the Authentication drop-down list select the authentication method for connecting to Salesforce. If you don’t mind storing your Salesforce credentials on our Skyvia server, select User Name & Password. If you prefer not to store your credentials, select OAuth 2.0.

    Connection Editor window

  7. If you have selected User Name & Password, on the previous step, specify your Salesforce account e-mail, password, and security token. Otherwise, if you have selected OAuth 2.0 authentication, click the Sign In with Salesforce button and log in via the Salesforce website on the opened page. The result OAuth token will be stored in the connection data. Your Salesforce credentials will not be stored on our website.

    Log In window

  8. Click Create Connection.

    Connection Editor window 2

To create a connection to Dropbox, perform the following steps:

  1. Click +NEW in the top menu.
  2. Click the Connection button in the menu on the left.
  3. In the opened Select Connector page, select Dropbox. To quickly find it, you can either use the Type to filter box or filter connectors by categories using the All list (for Dropbox, select the Storage category).
  4. The default name of a new connection is Untitled. Just click it to rename the connection, for example, to Dropbox1.

    Connection Editor window

  5. Click Sign In with Dropbox.
  6. Enter your Dropbox credentials and click Sign In.

    Sign In window

  7. Click the Allow button.

    Allow Access window

  8. Click Create Connection.

    Connection Editor window 2

Now we have the necessary connections created. Let’s create a package that performs the necessary operation.

Creating Package

Now let’s create the corresponding export package.

  1. Click +NEW in the top menu.
  2. In the Integration column, click Export. The export package details page will open.
  3. Rename your package by clicking and editing the package name. The default package name is Untitled. Please note, if you omit this step, the package name will remain Untitled in the list of created packages.
  4. Under Source, in the Connection list, click Select source and select Salesforce connection in the drop-down list. You can use the Type to filter box to find the connection quicker.

    Source Connection

  5. Then select Target Type you want to export data to. To save CSV file(s) to a file storage service or FTP, click CSV to storage service. After this, click Select target and select Dropbox connection.

    Target Type

    Next, specify the Folder where to place the result file.

  6. Click the Add new link to open the Task Editor.
  7. From the Object drop-down list, select Contact.
  8. All the Contact fields are selected automatically. Clear the checkboxes next to those fields, you don’t want to export.

    Task Editor page

  9. Click the Save button at the bottom of the Task Editor.
  10. Then click the Create button to create a package.

By default, Skyvia creates a CSV file with the name of the exported object (in our case “Contact”) and appended timestamp of the export operation, separated by the underscore character. Thus, the new files will not overwrite the older ones. However, you can disable adding a timestamp if you want the files to be overwritten in the package Naming options. Or you can set a custom name for the result file in the Target File Name box in Task Editor. In this case, the timestamp will also not be added to the file.

If you need to backup several Saleforce objects at once, you may simply add more export tasks with the necessary object in the same way — just repeat the steps 6-9 selecting the necessary objects instead of Contact.

Scheduling Package Execution

If you want the export package to run periodically in order for you to always have a fresh backup, schedule export package execution when creating a package.

For fresh backup, configure the package to run every day on a specified time.

Perform the following actions to set the schedule:

  1. Click Schedule on the left side of the toolbar.
  2. By default, State, Recurrence, and Run every parameters are already configured to run the package every day, so let’s keep these settings.
  3. Then, set the execution time of export operation next to Occur once at.
  4. Optionally, select At a specific time in the Starting list and specify the necessary date and time you want the schedule to be enabled from.
  5. Optionally, specify your Time Zone.

    Schedule window

  6. Click Save to schedule package execution.

After this, our package will run automatically every day on the specified time.

You can also visit Scheduling Packages to get more detailed information on setting a package schedule.

That is all, the package is created. It will backup Contacts to CSV files to Dropbox. To restore Contacts from a CSV file, you can use Import package.