Salesforce: Spring '11

Data Loader Developer's Guide

Last updated: April 10, 2011
© Copyright 2000-2011 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are other

names and marks. Other marks appearing herein may be trademarks of their respective owners.

Table of Contents

Table of Contents
Data Loader.........................................................................................................................................1
Data Loader Overview..............................................................................................................................................................1 When to Use the Data Loader..................................................................................................................................................2 Installing and Configuring the Data Loader.............................................................................................................................3 Using Data Loader....................................................................................................................................................................9 Running Batch Processes........................................................................................................................................................18 Data Loader Third-Party Licenses..........................................................................................................................................35 Index...................................................................................................................................................................................................37

i

Table of Contents

ii

delete. CSV files used for import and export. and the field mappings that map the field names in your import file with the field names in Salesforce. You can use Data Loader interactively through its user interface. and Developer Editions The Data Loader is a client application for the bulk import or export of data. or export Salesforce records. and actions in files used for automated processing. data sources. or set up automated batch processes launched from the command line. When importing data. mappings. extracts. Note: If commas are not appropriate for your locale. Unlimited. When you set up batch processes through the command line. use a tab or other delimiter. an open source version of Data Loader is available here. including custom objects Detailed success and error log files in CSV format A built-in CSV file viewer Support for Windows 7 and Windows XP In addition. you work interactively to specify the configuration parameters. The Data Loader offers the following key features: • • • • • • • • An easy-to-use wizard interface for interactive use An alternate command line interface for automated batch operations Support for large files with up to 5 million records Drag-and-drop field mapping Support for all objects. To get started. we encourage you to use Data Loader on Windows 7 instead. update. you specify the configuration.DATA LOADER Data Loader Overview Available in: Enterprise. it outputs CSV files. Note: If you are currently using Windows 2000. and loads data from comma separated values (CSV) files or from a database connection. When exporting data. Use it to insert. see the following topics: • • When to Use the Data Loader Installing the Data Loader 1 . the Data Loader reads. When you use the user interface.

Unlimited.Data Loader When to Use the Data Loader Note: In previous versions. we recommend you work with a Salesforce. 2 . such as nightly imports. the Data Loader has been known as the “AppExchange Data Loader“ and the “Sforce Data Loader.000 records.000. The object you need to import is supported by the web-based import wizards.000 records.com partner.” When to Use the Data Loader Available in: Enterprise.000. and Developer Editions The Data Loader complements the web-based import wizards that are accessible from the Setup menu in the online application.000 records. contact email address. You need to load into an object that is not yet supported by web-based importing.000 to 5. If you need to load more than 5. You want to schedule regular data loads. or lead email address. Use Web-based importing when: • • • You are loading less than 50. You want to export your data for backup purposes. Refer to the following guidelines to determine which method of importing best suits your business needs: Use the Data Loader when: • • • • You need to load 50. You want to prevent duplicates by uploading records according to account name and site.

5 or later (Windows XP or Windows 7). Unlimited. Some versions were released with earlier product names such as “AppExchange Data Loader” or “Sforce Data Loader.” You can run different versions at the same time on one computer. You can run the Data Loader wizards or run the application from the command line. multiple versions of the Data Loader client application have been available for download. Note: If you are currently using Windows 2000. 256 MB available memory. 3 . we encourage you to use Data Loader on Windows 7 instead. However. and Developer Editions User Permissions Needed To access the page to download the Data Loader: To use the Data Loader: “Modify All Data” The appropriate user permission for the operation you are doing.Installing and Configuring the Data Loader Installing the Data Loader INSTALLING AND CONFIGURING THE DATA LOADER Installing the Data Loader Available in: Enterprise.5 or later (Windows XP or Windows 7). Sun JVM 1. 5. 90 MB free disk space. If you have previously installed the latest version and want to install it again. 1. Click Next. you need: • • • • • Windows 7 or Windows XP. 2. Different versions have different entries in the Add or Remove Programs dialog in your Windows Control Panel. The latest version is always available from Salesforce at Your Name ➤ Setup ➤ Data Management ➤ Data Loader. 4. Installation Procedure Caution: Over time. click Your Name ➤ Setup ➤ Data Management ➤ Data Loader. Click Download the Data Loader and save the installer to your PC. “Create” on accounts to insert new accounts System Requirements To use the Data Loader. In the online application. Accept the license agreement and click Next. first remove it from your computer by using the Add or Remove Programs dialog in the Windows Control Panel. for example. Double-click the downloaded file to launch the InstallShield wizard. do not install multiple copies of the same version. Java JRE 1. 3.

Edit the fields as desired: Field Batch Size Description In a single insert. or click Change. Tip: If you experience login issues in the command line interface after upgrading to a new version of the Data Loader. 7. 1. 9. Unlimited. logins from untrusted IPs are blocked until they're activated. Start the Data Loader by choosing Start ➤ Programs ➤ salesforce. We recommend a value between 50 and 100. update.Installing and Configuring the Data Loader Configuring the Data Loader 6. or choose Start ➤ All Programs ➤ salesforce. The maximum value is 10. Click Install. Salesforce automatically sends you an activation email that you can use to log in.000 if the Use Bulk API option is selected. see Encrypting From the Command Line on page 19. to choose another directory. 2. 3. For information on the password encryption utility. 8.. 4 . This option is not available if the Use Bulk API option is selected. For example. Click Next. records moving to or from Salesforce are processed in increments of this size.com ➤ Data Loader ➤ Data Loader.com ➤ Data Loader ➤ Data Loader. you must enter mypasswordXXXXXXXXXX to log in. Logging In to the Data Loader If your organization restricts IP addresses. this option instructs the Data Loader to overwrite any existing data in mapped fields. and Developer Editions Use the Settings menu to change the default operation settings of the Data Loader. Click Finish. double-click the Data Loader icon on your desktop. Note that when you are updating records. The maximum value is 200. Insert Null Values Enable this option to insert blank mapped values as null values during data operations. Accept the default installation directory. Configuring the Data Loader Available in: Enterprise. Empty field values are ignored when you update records using the Bulk API. use a field value of #N/A. or delete operation. Choose Settings ➤ Settings.. if your password is mypassword. upsert. To start the Data Loader. and your security token is XXXXXXXXXX. please try re-encrypting your password to solve the problem. The email contains a security token that you must add to the end of your password. To set a field value to null when the Use Bulk API option is selected.

but use more memory on the client. Text. Picklist. It also applies to updates on accounts if your organization has territory assignment rules on accounts. To turn off compression. disable this option. In Data Loader version 15. Phone. For example. This option applies to inserts. Enter the URL of the Salesforce server with which you want to communicate. Larger values may improve performance. In Data Loader versions 14. values for fields of those types are truncated by the Data Loader if they are too large. In a single export or query operation. By default. Compression enhances the performance of the Data Loader and is turned on by default. Select this option to generate a success file when exporting data. Specify how many seconds the Data Loader waits to receive a response back from the server before returning an error for the request. This option forces files to be written in UTF-8 encoding. be used instead of the new behavior in Server Host Reset URL on Login Compression Timeout Query Request Size Generate success files for exports Read all CSVs with UTF-8 encoding Write all CSVs with UTF-8 encoding Use European Date Format Allow field truncation 5 . updates. You may want to disable compression if you need to debug the underlying SOAP messages.0 and later. Salesforce resets the URL after login to the one specified in Server Host. and upserts.salesforce. records are returned from Salesforce in increments of this size. The assignment rule overrides Owner values in your CSV file. This option forces files to open in UTF-8 encoding.000. enable this option. Select this option to direct the Data Loader to truncate data in the following types of fields when loading that data into Salesforce: Email.0 and earlier. and Text (Encrypted). the load operation fails if a value is specified that is too large. truncation.Installing and Configuring the Data Loader Configuring the Data Loader Field Assignment Rule Description Specify the ID of the assignment rule to use for inserts. Selecting this option allows you to specify that the previous behavior. change the URL to https://test. and upserts on cases and leads. if you are loading into a sandbox. To turn off this automatic reset. Select this option to support the date formats dd/MM/yyyy and dd/MM/yyyy HH:mm:ss. updates. Multi-select Picklist. even if they were saved in a different format. The maximum value is 2.com.

the deleted records are not stored in the Recycle Bin. Bulk API Hard Delete. A Salesforce user license is required for hard delete. This option is only available if the Use Bulk API option is selected. and hard delete records. • • If no value is specified. This option is only available if the Use Bulk API option is selected. delete.Installing and Configuring the Data Loader Configuring the Data Loader Field Description Data Loader versions 15. is disabled by default and must be enabled by an administrator. Using serial mode guarantees that batches are processed one at a time. the time zone of the computer where Data Loader is installed is used. Instead. This option is selected by default and has no effect in versions 14. the value specified here is used. The administrative permission for this operation. they become immediately eligible for deletion. Processing in parallel can cause database contention.String) method. Upload Bulk API Batch as Zip File (enable to upload binary attachments) Select this option to use the Bulk API to upload zip files containing binary attachments. Use Bulk API Select this option to use the Bulk API to insert.. If an incorrect value is entered. Enable serial mode for Bulk API Select this option to use serial instead of parallel processing for the Bulk API. Caution: When you select the Hard Delete operation.lang. This option is not available if the Use Bulk API option is selected. Time zone If a date value does not include a time zone.0 and later. the load may fail. In that case. The value can be a full name such as 6 . Valid values are any time zone identifier which can be passed to the Java getTimeZone(java.0 and earlier. update. Note that using this option may significantly increase the processing time for a load. GMT is used as the time zone and this fact is noted in the Data Loader log. the load operation fails for the row if a value is specified that is too large for the field. upsert. When this is severe. such as Attachment records or Salesforce CRM Content. The Bulk API is optimized to load or delete a large number of records asynchronously. It is faster than the default SOAP-based API due to parallel processing and fewer network round-trips.

Start at row 4. Data Loader Behavior with Bulk API Enabled Available in: Enterprise.Installing and Configuring the Data Loader Configuring the Data Loader Field Description America/Los_Angeles. you can use this setting to begin where the last successful operation finished. Empty field values are ignored when you update records using the Bulk API. The password for proxy server authentication. use a field value of #N/A. The username for proxy server authentication. and Developer Editions Enabling the Bulk API in Data Loader allows you to load or delete a large number of records faster than using the default SOAP-based API. The proxy server port. Click OK to save your settings. If your last operation failed. A load operation fails for the row if a value is specified that is too large for the field when the Use Bulk API option is selected. Unlimited. see Configuring the Data Loader on page 4 The following settings are not available on the Settings ➤ Settings page in Data Loader when the Use Bulk API option is selected: Insert Null Values This option enables Data Loader to insert blank mapped values as null values during data operations when the Bulk API is disabled. To set a field value to null when the Use Bulk API option is selected. For more information. there are some differences in behavior in Data Loader when you enable the Bulk API. if applicable. One important difference is that it allows you execute a hard delete if you have the administrative permission and license. However. Allow field truncation This option directs Data Loader to truncate data for certain field types when the Bulk API is disabled. or a custom ID such as GMT-8:00. 7 . The name of the Windows domain used for NTLM authentication. Proxy Host Proxy Port Proxy Username Proxy Password Proxy NTLM domain The host name of the proxy server.

com ➤ Data Loader ➤ Data Loader.Installing and Configuring the Data Loader Uninstalling the Data Loader Configuring the Data Loader to Use the Bulk API Available in: Enterprise. Go to Start ➤ Control Panel ➤ Add or Remove Programs. Caution: When you select the Hard Delete operation. Select the Use Bulk API option. 2. is disabled by default and must be enabled by an administrator. Uninstalling the Data Loader Available in: Enterprise. Note that using this option may significantly increase the processing time for a load. they become immediately eligible for deletion. Select the Data Loader program. Unlimited. To configure Data Loader to use the Bulk API for inserting. 3. 3. By default. Start the Data Loader by choosing Start ➤ Programs ➤ salesforce. Instead. and Developer Editions To uninstall the Data Loader client application: 1. deleting. and hard deleting records: 1. Choose Settings ➤ Settings. Processing in parallel can cause database contention. When this is severe. 4. the deleted records are not stored in the Recycle Bin. 2. The uninstaller removes the program from your computer. The administrative permission for this operation. Unlimited. the load may fail. and Developer Editions The Bulk API is optimized to load or delete a large number of records asynchronously. upserting. Note: You can also select the Enable serial mode for Bulk API option. It is faster than the SOAP-based API due to parallel processing and fewer network round-trips. Using serial mode guarantees that batches are processed one at a time. Click Remove. Bulk API Hard Delete. updating. Click OK. Data Loader uses the SOAP-based API to process records. 8 . A Salesforce user license is required for hard delete.

“1” False values (case insensitive) = “no”.SSSPacific Standard Time yyyy-MM-dd'T'HH:mm:ss.SSS GMT-08:00 yyyy-MM-dd'T'HH:mm:ss.SSS+/-HHmm: • • • • • • • • yyyy is the four-digit year MM is the two-digit month (01-12) dd is the two-digit day (01-31) HH is the two-digit hour (00-23) mm is the two-digit minute (00-59) ss is the two-digit seconds (00-59) SSS is the three-digit milliseconds (000-999) +/-HHmm is the Zulu (UTC) time zone offset The following date formats are also supported: • • • • • • • • • • yyyy-MM-dd'T'HH:mm:ss.SSS -800 yyyy-MM-dd'T'HH:mm:ss. Unlimited.SSSPST yyyy-MM-dd'T'HH:mm:ss. see Uploading Attachments on page 15 and Uploading Content with the Data Loader on page 16. Base64 fields are only used to insert or update attachments and Salesforce CRM Content. For more information. and Developer Editions Data Loader supports the following data types: Base64 String path to file (converts the file to a base64–encoded array).SSS-800 yyyy-MM-dd'T'HH:mm:ss 9 .Using Data Loader Data Types Supported by the Data Loader USING DATA LOADER Data Types Supported by the Data Loader Available in: Enterprise. “0” Date Formats We recommend you specify dates in the format yyyy-MM-ddTHH:mm:ss. “true”. “y”. Boolean • • True values (case insensitive) = “yes”.SSS'Z' yyyy-MM-dd'T'HH:mm:ss. “off ”.SSS Pacific Standard Time yyyy-MM-dd'T'HH:mm:ss. “n”.SSSGMT-08:00 yyyy-MM-dd'T'HH:mm:ss. “false”.SSS PST yyyy-MM-dd'T'HH:mm:ss. “on”.

the earliest valid date is 1699-12-31T16:00:00. European date formats aredd/MM/yyyy and dd/MM/yyyy HH:mm:ss. If your computer's locale is east of Greenwich Mean Time (GMT). 4000. For example. we recommend that you change your computer setting to GMT in order to avoid date adjustments when inserting or updating records. select the Use European date format box in the Settings dialog. or just after midnight on December 31. Integer Standard integer string String All valid XML strings. The earliest valid date is 1700-01-01T00:00:00Z GMT. or 4:00 PM on December 31. make sure that all Salesforce IDs you enter in the Data Loader are in the correct case. 1700. A knowledge base solution for this issue is available in the Salesforce Help & Training window. • Double Standard double string ID A Salesforce ID is a case-sensitive 15-character or case–insensitive 18-character alphanumeric string that uniquely identifies a particular record. Tip: To ensure data quality. or just after midnight on January 1. invalid XML characters are removed. in the Pacific timezone. search for “data loader date. 10 . 1699. Note: These values are offset by your timezone.Using Data Loader Data Types Supported by the Data Loader • • • • • yyyy-MM-dd HH:mm:ss yyyyMMdd'T'HH:mm:ss yyyy-MM-dd MM/dd/yyyy HH:mm:ss MM/dd/yyyy Note the following tips for date formats: • • To enable date formats that begin with the day rather than the month.” Only dates within a certain range are valid. The latest valid date is 4000-12-31T00:00:00Z GMT.

com ➤ Data Loader ➤ Data Loader. and your security token is XXXXXXXXXX. Review the generated query and edit if necessary. 6. the contents of that file are replaced. to select the CSV file to which the data will be exported. For object descriptions. you can choose to include (Export All) or exclude (Export) soft-deleted records. Unlimited. Click Export or Export All . You can enter a new file name to create a new file or choose an existing file. or click No to choose another file. Tip: You can use a SOQL relationship query to include fields from a related object. select the Account object. if your password is mypassword. 5. Click Next. (Until you log out or close the program. b. with developer name noted in parentheses. 7. c. Choose the fields you want to export. When you export. you will not be asked to log in again. and conditions for selecting rows in the source object. For example: Select Name. Optionally. The objects will be listed by localized label name. Salesforce automatically sends you an activation email that you can use to log in. Product2. The email contains a security token that you must add to the end of your password. Start the Data Loader by choosing Start ➤ Programs ➤ salesforce. For example. Similar to the SELECT command in SQL. you must enter mypasswordXXXXXXXXXX to log in. Click Log in to log in. 2. a list of fields to retrieve. Create a SOQL query for the data export. you will see that the CSV viewer displays all the Account names and their IDs. For example. For example. a. 1. Choose an object. After your login completes successfully. 3. and Developer Editions User Permissions Needed To export records: To export all records: “Read” on the records “Read” on the records You can use the Data Loader export wizard to extract data from any Salesforce object. Click Browse. all the data to which you have read access will be returned. Enter your Salesforce username and password. If your object name does not display in the default list. click Next.Using Data Loader Exporting Data Exporting Data Available in: Enterprise. Click Yes to confirm this action. If you do not select any conditions. Product2Id. Pricebook2. select conditions to filter your data set. SOQL is the Salesforce Object Query Language that allows you to construct simple but powerful query strings.) If your organization restricts IP addresses. 4. These commands can also be found in the File menu. logins from untrusted IPs are blocked until they're activated. check Id and Name in the query fields and click Finish. check Show all objects to see a complete list of objects that you can access. As you follow the next steps.ProductCode FROM PricebookEntry WHERE IsActive = true 11 . see the Web Services API Developer's Guide..Name. Pricebook2Id. If you select an existing file.. SOQL allows you to specify the source object (such as account).

Unlimited. click and drag fields from the list of Salesforce fields at the top to the list of CSV column header names at the bottom.Name does not work. Account. PriceBookEntry. PricebookEntry. see Inserting. click and drag the Name field to the right of the NAME column header field. (SELECT Quantity. or click OK to close. we recommend that you use the weekly export feature in the online application to export attachments. or Deleting Data Using the Data Loader on page 13. 10. For example. a confirmation window summarizes your results. 3. Note that for a delete operation. Name. For more information. the contents of that file are replaced. Click View Extraction to view the CSV file. For more details. For example. 2.Family FROM OpportunityLineItems) FROM Opportunity For more information on SOQL. As a workaround. Click OK to use your mapping for the current operation. Optionally. queries similar to the following return an error: SELECT Amount. ListPrice. To automatically match fields with columns. The Data Loader automatically populates the list at the bottom of the window.NAME instead of Account. or update files. If you select an existing file. Click Yes to confirm this action. the fully specified field names are case-sensitive. Id. then click Yes to confirm. Click Finish. 8. see the Web Services API Developer's Guide. or click No to choose another file. After the operation completes. For example.Using Data Loader Defining Field Mappings Or: Select Id. see Reviewing Output Files on page 17. automatic matching works only on the ID field.product2. Defining Field Mappings Available in: Enterprise. To manually match fields with columns. 12 . based on the similarity of field and column names. use the Mapping Dialog window to associate Salesforce fields with the columns of your CSV file.UnitPrice. click Save Mapping to save this mapping for future use. A progress information window reports the status of the operation. if you are inserting new Account records where your CSV file contains the names of new accounts. Note: The Data Loader currently does not support the extraction of attachments. click Auto-Match Fields to Columns. PricebookEntry. LastName. 9. and Developer Editions Whenever you insert. Updating. 1. using ACCOUNT. The Data Loader does not support nested queries or querying child objects.Name FROM Contact When using relationship queries in the Data Loader.Name. Specify a name for the SDL mapping file. 4. delete.

if you are inserting Account records. For example. 2. Update. or Deleting Data Using the Data Loader Available in: Enterprise. click Next. Click Next to continue. Click Log in to log in. Enter your Salesforce username and password. update. If your object name does not display in the default list. if your password is mypassword. you could specify a CSV file named insertaccounts.com ➤ Data Loader ➤ Data Loader. if you are inserting Account records. The email contains a security token that you must add to the end of your password.Using Data Loader Inserting. select Account. After your login completes successfully. upsert. or delete existing records. For more information on external IDs. Unlimited. Click Next. If no match is found. Choose an object. These commands can also be found in the File menu. Upsert. click OK. to insert new Account records. the existing record is updated with the values in your file. 5. Delete or Hard Delete. Updating. see “Custom Field Attributes” in the Salesforce online help. select which field to use for matching. begin by clicking Insert. The column may be either an external ID (a custom field with the “External ID” attribute). For more information. you are not asked to log in again. modify existing records. When you hard delete records. and Developer Editions User Permissions Needed To insert records: To update records: To upsert records: To delete records: To hard delete records “Create” on the record “Edit” on the record “Create” or “Edit” on the record “Delete” on the record “Delete” on the record The insert. If the object has no external ID fields. Click Insert. delete. or Deleting Data Using the Data Loader Inserting.if a record in your file matches an existing record.csv containing a Name column for the names of the new accounts. with developer name noted in parentheses. then the record is created as new. 13 . 4. you must enter mypasswordXXXXXXXXXX to log in. Salesforce automatically sends you an activation email that you can use to log in.. and your security token is XXXXXXXXXX. Updating. or Id (the Salesforce record ID). For example. Click Browse. 1. see Configuring the Data Loader on page 4. check Show all objects to see a complete list of the objects that you can access. For example. 3. the deleted records are not stored in the Recycle Bin and become immediately eligible for deletion. to select your CSV file. Your CSV file must contain a column of ID values for matching against existing records. The objects are listed by localized label name. 6. 7.. For object descriptions. From the drop-down list. and hard delete wizards in the Data Loader allow you to add new records. Id is automatically used. Note that “upsert” is a combination of inserting and updating . (Until you log out or close the program.) If your organization restricts IP addresses. Start the Data Loader by choosing Start ➤ Programs ➤ salesforce. If you are performing an upsert: a. For example. logins from untrusted IPs are blocked until they're activated. see the Web Services API Developer's Guide. After the object and CSV file are initialized.

to specify a directory for these files. click View Errors to open your errors file. Click Finish to perform the operation. the Data Loader generates two unique CSV log files. If you get a timeout error when loading a file. For more details and an example of usage. 3. After the operation completes. As the operation proceeds. See Reviewing Output Files on page 17. review your success and error log files. or click OK to close. Click Next to continue. Note that matching is done according to record ID. 2. 11. For every operation. or Deleting Data Using the Data Loader on page 13. so you must check the results. See Inserting. or “Running Reports” in the Salesforce online help. Click View Successes to view your success file. Even if the processing failed. For more information. the Bulk API places the remainder of the file back in the queue for later processing. and update your data. 5. After the operation. Performing Mass Updates Available in: Enterprise. See Exporting Data on page 11. enable that external ID for record matching by selecting its name from the drop-down list. use the backup file to update the records to their previous values. split your file into smaller files. Click Choose an Existing Map to select an existing field mapping. Click Next.Using Data Loader Inserting. or Deleting Data Using the Data Loader b. and then click Yes to confirm.” Click Browse. 8. one file name starts with “success.. There is a five-minute limit to process 100 records when the Bulk API is enabled. or by running a report. If you make no selection here. a progress information window reports the status of the data movement. 9. save an extra copy of the generated CSV file. If the Bulk API continues to exceed the 10-minute limit on subsequent attempts. see Defining Field Mappings on page 12. Make sure your report includes the record ID. if it takes longer than 10 minutes to process a file. Also. Open your working file in a CSV editor such as Excel. Launch the Data Loader and follow the update wizard. 10. 4. and try again. As a backup measure. the file is placed back in the queue and reprocessed up to 10 times before the operation is permanently marked as failed. 6. Obtain your data by performing an export of the objects you wish to update..” while the other starts with “error. we recommend the following steps: 1. Define how the columns in your CSV file map to Salesforce fields. If you made a mistake. review Performing Mass Updates and Performing Mass Deletes for tips and best practices. or click Create or Edit a Map to create a new map or modify an existing map. 13. Updating. If your file includes the external IDs of an object that has a relationship to your chosen object. 14 . Tip: • • If you are updating or deleting large amounts of data. you can use the related object's Id field for matching by mapping it in the next step. see Reviewing Output Files on page 17. Updating. and Developer Editions To update a large number of records at one time. a confirmation window summarizes your results. some records could have completed successfully. 12. Unlimited.

Name . (See Exporting Data on page 11.jpg. checkbox. For example. make sure to select the Include Attachments.Using Data Loader Uploading Attachments Performing Mass Deletes Available in: Enterprise. Updating.attachment1. See Reviewing Output Files on page 17. note the following: • • If you intend to upload via the Bulk API.) Save an extra copy of the generated CSV file. such as Description. this time using only the record ID as the desired criteria. review your success and error log files. 15 . we recommend the following steps: 1.. Confirm that the CSV file you intend to use for attachment importing contains the following required columns (each column represents a Salesforce field): • • • ParentId . Uploading Attachments You can use the Data Loader to upload attachments to Salesforce. Unlimited.doc. Ensure that the values in the Body column contain the full file name of the attachments as they exist on your computer.the name of the attachment file. Updating. verify that Upload Bulk API Batch as Zip File (enable to upload binary attachments) on the Settings ➤ Settings page is enabled.C:\Export\files\attachment2. if an attachment named myattachment. see Inserting. and Developer Editions To delete a large number of records at one time using the Data Loader. or Deleting Data Using the Data Loader on page 13.attachment2. which causes the file Attachment. Before uploading attachments.jpg. Next. If you are migrating attachments from a source Salesforce organization to a target Salesforce organization.doc The CSV file can also include other optional Attachment fields. Map only the ID column.C:\Export\attachment1. or Deleting Data Using the Data Loader on page 13. export the objects you wish to delete.the Salesforce ID of the parent record. 2. On the Schedule Export page.Body 50030000000VDowAAG. being sure to select all fields.. Your CSV file might look like this: ParentId. Body must specify C:\Export\myattachment. See Inserting.jpg. Proceed with an insert or upsert operation. 2. see “Exporting Backup Data” in the Salesforce online help. 3. export the objects you wish to delete. For more information on the weekly export service.gif 701300000000iNHAAY. 4. make sure to select the Show all Salesforce objects checkbox and the Attachment object name in the list. You can use this CSV file to upload the attachments. After the operation.Name.the absolute path to the attachment on your local drive. At the Select data objects step. Launch the Data Loader and follow the delete or hard delete wizard.jpg is located on your computer at C:\Export. As a backup measure. Body . begin by requesting a weekly data export for the source organization. such as myattachment.csv to be included in your export. To upload attachments: 1.

You can't export content using the Data Loader. This adds approximately 30% to the file size.Using Data Loader Uploading Content with the Data Loader Uploading Content with the Data Loader Available in: Enterprise. you must specify the URL in ContentUrl. • VersionData . • • 1. ContentUrl . Do not use PathOnClient or VersionData to upload links.complete file path on your local drive (for uploading documents only). defaults to the user uploading the file.workspace ID. Log in to Salesforce. Create a CSV file with the following fields: • • Title . Name FROM RecordType WHERE SobjectType = 'ContentVersion' To determine the RecordTypeId values for your organization using the AJAX Toolkit: a. verify that Upload Bulk API Batch as Zip File (enable to upload binary attachments) on the Settings ➤ Settings page is enabled. and Developer Editions You can use the Data Loader to bulk upload documents and links into workspaces in Salesforce CRM Content. Note: If there are commas in the description. To determine the RecordTypeId values for your organization using the Data Loader. VersionData identifies the location and extracts the format and PathOnClient identifies the type of document being uploaded. Before uploading documents or links. you must specify the actual path in the VersionData and PathOnClient fields in the CSV file.URL (for uploading links only). • • • • • PathOnClient . Note: If you publish to a workspace that has restricted content types. follow the steps in Exporting Data. Unlimited. Note: Files are converted to base64 encoding on upload. Description . RecordTypeId . OwnerId . use double quotes around the text. note the following: • • If you intend to upload via the Bulk API. When you upload a document from your local drive using the Data Loader.content type ID. When you upload a link using the Data Loader. you must specify RecordTypeId.complete file path on your local drive (for uploading documents only).file name. Your SOQL query might look like this: Select Id. 16 .(optional) file or link description. FirstPublishLocationId .(optional) file owner.

5. In it. The “error” file contains all records that were rejected from the load operation.TagsCsv testfile. Enter the instanceName. there is a column that describes why the load failed.058700000004Cd0. Specify a number of rows to view. click Open Success. • TagsCsv .pdf. see Configuring the Data Loader on page 4.describeSObject("ContentVersion") d. The CSV file opens in a new window.Using Data Loader Reviewing Output Files b. Unlimited.Description. Reviewing Output Files Available in: Enterprise. Optionally. The default is 1000.OwnerId. Note: To generate success files when exporting data.c:\files\testfile.one 2. Click on the arrows for recordTypeInfos. see Inserting. You can see the instanceName in the URL field of your browser after logging in to Salesforce. For more information. The Data Loader has a built-in CSV file viewer with which you can open these files. To view the last success file.com/soap/ajax/21. Choose View CSV from the View menu of the Data Loader. and then click OK to exit the window.” During every export.” while the other starts with “error.connection. A sample CSV file is: Title.012300000008o2sAQG. click Open in External Program to open the file in the associated external program. such as na1. Each row in the CSV file corresponds to one Salesforce record. c. there is a column for newly generated record IDs. 17 . All of the RecordTypeId values for your organization are listed. the Data Loader saves extracted data to a CSV file that you specify in the wizard.0/debugshell."This is a test file. 3. select the Generate success files for exports setting.PathOnClient.c:\files\testfile.salesforce. for your organization.html. To view the last error file. All documents and links will be available in the specified workspace. 2.FirstPublishLocationId.005000000000000. Click Close to return to the CSV Chooser window.VersionData. use for bulk upload". Press Enter. In the AJAX Toolkit Shell page type: sforce. Enter this URL in your browser: http://instanceName. To view output files from a Data Loader operation: 1. the Data Loader generates two unique CSV output files. and Developer Editions After every import or export. Upload the CSV file for the ContentVersion object. such as Microsoft® Office Excel. e. or Deleting Data Using the Data Loader on page 13. click Open Error.(optional) tag. One file name starts with “success. To view a CSV file of your choice.pdf. click Open CSV. In it. 4. Updating.RecordTypeId. The “success” file contains all records that were successfully loaded.

log Contains a detailed chronological list of Data Loader log entries. and Developer Editions If you need to investigate a problem with the Data Loader. See the following topics: • • • • • • • • • • • Understanding Installed Directories and Files Encrypting From the Command Line Upgrading Your Batch Mode Interface Using the Command Line Interface Configuring Batch Processes Data Loader Process Configuration Parameters Data Loader Command Line Operations Configuring Database Access Mapping Columns Running Individual Batch Processes Data Access Objects 18 . such as logging in to Salesforce. RUNNING BATCH PROCESSES Running in Batch Mode You can run the Data Loader in batch mode from the command line. ensure that the password provided in the configuration parameters is encrypted. These files can be opened with commonly available text editor programs. it includes log entries for the creation of proxy server network connections.log in either the Run dialog or the Windows Explorer address bar. you may need to obtain a new security token. Log entries marked “INFO” are procedural items.Running Batch Processes Troubleshooting Data Loader Operations Troubleshooting Data Loader Operations Available in: Enterprise.log. If you are having login issues from the UI.log A supplemental log that contains additional information not captured in sdl. The two log files are: sdl. Unlimited.log and %TEMP%\sdl_out.com Customer Support. you can access log files that track the operations and network connections made by the Data Loader. such as Microsoft Notepad. or if requested by salesforce. You can quickly open these files by entering %TEMP%\sdl. sdl_out. Log entries marked “ERROR” are problems such as a submitted record missing a required field. If you are having login issues from the command line. For example.

provided you accepted the default installation directory.class. You can copy this file to the conf installation directory to use it for batch processes. see Using the Command Line Interface on page 20.bat for running batch processes.proxyPassword Use the utility described below to perform encryption. To use the encryption utility: 1. At the command line. installing the Data Loader creates several directories under the installation directory. Encrypting From the Command Line When running the Data Loader in batch mode from the command line.com\Data Loader version_number\bin.xml.com\Data Loader version_number.bat for encrypting passwords and process. and log-conf. The config. see Upgrading Your Batch Mode Interface on page 20.password sfdc. Using the Encryption Utility The Data Loader offers an encryption utility to secure passwords specified in configuration files. The following directories are involved in running the program from the command line for automated batch processing: bin Contains the batch files encrypt. If you installed the program to a different location. For example.Running Batch Processes Understanding Installed Directories and Files Note: If you have used the batch mode from the command line with a version earlier than 8. samples Contains subdirectories of sample files for reference. Contains the configuration files config. For information on running the Data Loader from the command line. you must encrypt the following configuration parameters: • • sfdc. conf The default configuration directory.0. please substitute that directory path as appropriate. File Path Convention The file paths provided in these topics start one level below the installation directory. 2.0 and later.properties.properties file that is generated when you modify the Settings dialog in the graphical user interface is located at C:\Documents and Settings\your Windows username\Application Data\salesforce. Run \bin\encrypt.bat. \bin means C:\Program Files \salesforce. Understanding Installed Directories and Files In versions 8. Loader. follow the prompts provided to execute the following actions: 19 .

A success or failure message is printed to the command line. If you are using a version earlier than 8.bat. Upgrading Your Batch Mode Interface The batch mode interface in versions 8. omitting any leading or trailing spaces.properties.0 and later of the Data Loader are not backwards-compatible with earlier versions. Continue to use that version for batch processes.properties file from the new GUI If you originally generated your config. Use this new file with the new batch mode interface. your options are as follows: Maintain the old version for batch use Do not uninstall your old version of the Data Loader. Unlimited. In the configuration file. see Encrypting From the Command Line on page 19. see Understanding Installed Directories and Files on page 19. you can provide a key file for the encryption. For more information about using process. Encrypt text Generates an encrypted version of a password or other text. 20 .bat.Running Batch Processes Upgrading Your Batch Mode Interface Generate a key Key text is generated onscreen from the text you provide. Optionally.0 to run batch processes. The key file can then be used for encryption and decryption. For more information. Carefully copy the key text to a key file. For more information. use the new version to set the same properties and generate a new file.properties file If your old config. but your integrations will continue to work.properties file from the graphical user interface. see Running in Batch Mode on page 18. install the new version alongside the old version and dedicate the old version solely to batch processes. Optionally.properties file was created manually. and Developer Editions For automated batch operations such as nightly scheduled loads and extractions. From the command line. add -help to the command contained in process. verifies whether the encrypted password provided matches its decrypted version. Using the Command Line Interface Available in: Enterprise. be sure to include your encrypted password in the configuration file. Verify encrypted text Given encrypted and decrypted versions of a password. Generate a new config. navigate into the bin directory and type process.bat. make sure that the encrypted text is copied precisely and the key file is mentioned. Before running any batch operation. then you must manually update it for the new version. which takes the following parameters: • • The directory containing config. To view tips and instructions.xml. You cannot take advantage of newer features such as database connectivity. run Data Loader from the command line. see Running Individual Batch Processes on page 35. Manually update your config. The name of the batch process bean contained in process-conf. For more information.

Note: These topics only apply to version 8.com/sforce/2005/06/sforce_data_loa. You can set the minimum and maximum heap size. such as sendAccountsFile_lastrun. You can change parameters at runtime by giving param=value as program arguments. adding process. see Running in Batch Mode on page 18. such as sendAccountsFile_lastrun. 21 . the config.properties. which are represented by ProcessRunner beans. are generated and saved to the location specified by lastRunOutputDirectory. output files containing information about the last run. This value is also used as the non-generic thread name and for configuration backing files (see below). Data Loader configuration files are installed at the following location: C:\Program Files\salesforce. -Xms256m -Xmx256m sets the heap size to 256 MB. For information on the password encryption utility.xml. If you do not specify a configuration directory. If you have an earlier version of the Data Loader.properties. see the following blog post for command line instructions: http://blog. For example.0 and later.html Tip: If you experience login issues in the command line interface after upgrading to a new version of the Data Loader. If you want to implement enhanced logging.operation=insert to the command changes the configuration at runtime. setting process. If enableLastRunOutput is set to false. If you use process-conf. the current directory is used.xml. use a copy of log-conf. file. please try re-encrypting your password to solve the problem.xml. enableLastRunOutput If set to true (the default).Running Batch Processes Configuring Batch Processes The Data Loader runs whatever operation. Otherwise. A process should have ProcessRunner as the class attribute and the following properties set in the configuration file: name Sets the name of the ProcessRunner bean. are written. The default value is \conf. the files are not generated or saved.xml to configure your Data Loader processes. For example.sforce. For more information on batch mode. see Encrypting From the Command Line on page 19. lastRunOutputDirectory The directory location where output files containing information about the last run. the value is the setting value. Configuring Batch Processes Use \samples\conf\process-conf. configOverrideMap A property of type map where each entry represents a configuration setting: the key is the setting name. or map is specified in the configuration file that you specify. this value is not used because the files are not generated. By default. If set to false.com\Data Loader version number\conf The batch process configuration file is process-conf.properties file is used for parameter settings.name to the name of a process specifies a process to run.

UTF-8 encoding Sample value: true Write all This option forces files to be written in UTF-8 CSVs with encoding. even if they were saved in a different CSVs with format. dataAccess. The configuration backing file is managed programmatically and does not require any manual edits. The settings in configOverrideMap take precedence over those in the configuration backing file. Standard types are csvWriter. you can specify the following configuration parameters in config. databaseWrite. Note the implication for a large parameter value: if an error occurs. the option is also represented in the graphical user interface at Settings ➤ Settings.type string N/A Sample value: csvWrite Number of records written to your back-end or other external database at a time. csvRead.name string Not applicable (N/A) Name of the data source to use.properties. The maximum value is 2. all records in dataAccess.readBatchSize integer N/A Sample value: 50 Standard or custom data source type.writeUTF8 boolean dataAccess. dataAccess.csv Number of records read from your back-end or other external database at a time. Sample value: c:\dataloader\data\extractLead.000. see Data Loader Process Configuration Parameters on page 22. use the name of the database configuration in database-conf.xml. In some cases. and is used to load default configuration parameters in config. For databases. UTF-8 encoding Sample value: true dataAccess. Data Loader Process Configuration Parameters When running the Data Loader in batch mode from the command line.Running Batch Processes Data Loader Process Configuration Parameters The configuration backing file stores configuration parameter values from the last run for debugging purposes. Parameter Name Data Type Equivalent Option in Settings Dialog Description This option forces files to open in UTF-8 Read all encoding. and databaseRead. such as a CSV file name.readUTF8 boolean dataAccess. The maximum value is 200.writeBatchSize integer N/A 22 . For the names and descriptions of available process configuration parameters.properties.

We recommend setting the value to 1 when you need to diagnose problems with writing to a database.lastRunDate parameter. you can disable the generation of output files such as sendAccountsFile_lastRun.key The initial setting for the process.initialLastRunDate date N/A example: 2006-04-13T13:50:32.properties. you can change the location where output files such as process. See Encrypting From the Command Line on page 19. For an explanation of the date format syntax. To stop the writing of these files. Files of this type are saved by default to the conf directory. set this option to false. each record is processed individually (not in batch) and errors are specific to a given record.enableExtractSuccessOutput boolean When running the Data Loader in batch mode. which can be used in a SQL string and is automatically updated when a process has run successfully. Alternatively. using process. files for Sample value: true exports process.encryptionKeyFile string (file name) N/A Sample value: c:\dataloader\conf\my.enableLastRunOutput boolean N/A Sample value: true Name of the file that contains the encryption key. Sample value: 500 Generate Select this option to generate a success file when success exporting data.SSS+/-HHmm. if the value is set to 1. see Date Formats on page 9.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description the batch are rolled back. Format must be yyyy-MM-ddTHH:mm:ss.lastRunOutputDirectory string (directory) N/A 23 . process. In contrast.lastRunOutputDirectory. For process.423-0700 When running the Data Loader in batch mode. you can change the location of the directory where these files are saved. process.

properties are written. process. Sample value: process.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description sendAccountsFile_lastRun. Files of this type are saved by default to the conf directory. process. See Data Loader Command Line Operations on page 30. If your last operation failed. you can use this setting to begin where the last successful operation finished.enableExtractSuccessOutput process.loadRowToStartAt number Start at row Sample value: 1008 Name of the the field mapping file to use.csv 24 .xml. Sample value: process.operation string N/A Sample value: extract The directory where “success” and “error” output files are saved.outputSuccess string (file name) on page 23. change the value of this option to the full path where the last run files should be written.csv The name of the CSV file that stores success data from the last operation. See also process.enableLastRunOutput. To change the location. See Mapping Columns on page 34.outputError string (file name) N/A c:\dataloader\status\myProcessErrors. Sample value: N/A c:\dataloader\status\myProcessSuccesses.mappingFile string (file name) N/A c:\dataloader\conf\accountExtractMap.sdl The operation to perform. The file names are automatically generated for each operation unless you specify otherwise in process-conf.statusOutputDirectory string (directory) N/A process. you can stop the files from being written. Sample value: c:\dataloader\status The name of the CSV file that stores error data from the last operation. Alternatively. using process.

See also sfdc. updates. It also applies to updates on accounts if your organization has territory assignment rules on accounts. Processing in parallel can cause database contention.useBulkApi. process.bulkApiCheckStatusInterval integer N/A Sample value: 5000 Select this option to use serial instead of parallel processing for the Bulk API.useEuropeanDates boolean sfdc. sfdc.connectionTimeoutSecs integer N/A Sample value: 60 25 .Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Use European Date Format Description Select this option to support the date formats dd/MM/yyyy and dd/MM/yyyy HH:mm:ss. This option applies to inserts.useBulkApi. Sample value: true The number of seconds to wait for a connection during API calls.bulkApiSerialMode boolean Enable serial mode for Bulk API Upload Bulk API Batch as Zip File (enable to upload binary attachments) Select this option to use the Bulk API to upload zip files containing binary attachments. Sample value: true Specify the ID of the assignment rule to use for inserts. such as Attachment records or Salesforce CRM Content.useBulkApi.assignmentRule string Assignment Sample value: 03Mc00000026J7w Rule The number of milliseconds to wait between successive checks to determine if the asynchronous Bulk API operation is complete or how many records have been processed. sfdc. and upserts. Note that using this option may significantly increase the processing time for a load. updates. When this is severe. The assignment rule overrides Owner values in your CSV file. and upserts on cases and leads. Using serial mode guarantees that batches are processed one at a time. See also sfdc. See also sfdc. the load may fail. Sample value: false sfdc. We recommend a value of 5000.bulkApiZipContent boolean sfdc.

records are returned from Salesforce in increments of this size. sfdc.0 The Salesforce object used in the operation. See sfdc. For more information about external IDs. see “Custom Field Attributes” in the Salesforce online help. sfdc. messages are sent to STDOUT unless you specify an alternate location in sfdc. sfdc.minRetrySleepSecs on page 27. if you are loading into a sandbox.com. For example.log If true. As messages are sent or received.salesforce. please monitor your available disk storage appropriately.debugMessages boolean N/A Sample value: false See process. enables SOAP message debugging. sfdc.endpoint URL Server Host Sample production value: https://login.debugMessagesFile. As the file does not have a size limit.salesforce. change the URL to https://test. they are appended to the end of the file. The maximum value is 2.enableRetries boolean N/A Sample value: true Enter the URL of the Salesforce server with which you want to communicate. specifies the custom field with the “External ID” attribute that are used as a unique identifier for data matching.000.extractionRequestSize integer 26 . Sample value: N/A \lexiloader\status\sfdcSoapTrace. enables repeated attempts to connect to Salesforce servers. sfdc.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description If true.enableExtractSuccessOutput sfdc.maxRetries on page 27 and sfdc.externalIdField string N/A Query Request Size Sample value: LegacySKU__c In a single export or query operation.entity string N/A Sample value: Lead Used in upsert operations. Larger values sfdc. By default.debugMessagesFile string (file name) on page 23. Stores SOAP messages sent to or from Salesforce.com/services/Soap/u/21.

Sample value: false In a single insert. sfdc.loadBatchSize integer Batch Size Sample value: 100 The maximum number of repeated attempts to connect to Salesforce. this option instructs the Data Loader to overwrite any existing data in mapped fields.noCompression boolean Compression Sample value: false 27 . The wait time increases with each try.enableRetries on page 26. See sfdc. You may want to disable compression if you need to debug the underlying SOAP messages. but use more memory on the client. upsert. sfdc. OwnerId FROM Lead string N/A sfdc. sfdc. enable this option. See sfdc.maxRetries integer N/A Sample value: 3 The minimum number of seconds to wait between connection retries. records moving to or from Salesforce are processed in increments of this size.extractionSOQL FirstName. sfdc. update. sfdc. To turn off compression. LastName.enableRetries on page 26.insertNulls boolean Insert Null Values Enable this option to insert blank mapped values as null values during data operations. or delete operation. The maximum value is 200. see the Web Services API Developer's Guide. AnnualRevenue. Sample value: SELECT Id. Rating.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description may improve performance. For more information on SOQL. Note that when you are updating records.minRetrySleepSecs integer N/A Sample value: 2 Compression enhances the performance of the Data Loader and is turned on by default. Sample value: 500 The SOQL query for the data export. We recommend a value between 50 and 100.

proxyUsername on page 28.proxyHost URL Proxy Host Sample value: http://myproxy.company. Salesforce resets the URL after login to the one specified in sfdc. if applicable.doe By default. sfdc. sfdc. the value specified here is used. sfdc. disable this option.To turn off this automatic reset. • If no value is specified. Sample value: 4285b36161c65a22 The proxy server port.timeoutSecs integer Timeout Sample value: 540 If a date value does not include a time zone.username on page 30. See also Encrypting From the Command Line on page 19.com sfdc.timeZone string Time zone 28 .proxyPort integer Sample value: 8000 The username for proxy server authentication.proxyUsername string Sample value: jane.endpoint. sfdc.proxyPassword encrypted Proxy string Password Proxy Port Proxy Username An encrypted password that corresponds to the proxy username provided in sfdc.resetUrlOnLogin boolean Reset URL on Login Sample value: false Specify how many seconds the Data Loader waits to receive a response back from the server before returning an error for the request. Sample value: 4285b36161c65a22 The host name of the proxy server.internal. sfdc.password encrypted string N/A An encrypted Salesforce password that corresponds to the username provided in sfdc. sfdc.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description sfdc. See also Encrypting From the Command Line on page 19. the time zone of the computer where Data Loader is installed is used.

In Data Loader versions 14. and hard delete records. In Data Loader version 15. the load operation fails if a value is specified that is too large. 29 .useBulkApi boolean Use Bulk API Select this option to use the Bulk API to insert.String) method. This option is not available if the Use Bulk API option is selected. This option is selected by default and has no effect in versions 14. truncation.0 and earlier. It is faster than the default SOAP-based API due to parallel processing and fewer network round-trips. In that case.bulkApiSerialMode. GMT is used as the time zone and this fact is noted in the Data Loader log. upsert. The Bulk API is optimized to load or delete a large number of records asynchronously. delete.truncateFields boolean Allow field truncation Sample value: true sfdc. This value is the time zone on the computer where Data Loader is installed. You can retrieve the default value by running the TimeZone. Text. be used instead of the new behavior in Data Loader versions 15. Valid values are any time zone identifier which can be passed to the Java getTimeZone(java. The value can be a full name such as America/Los_Angeles.Running Batch Processes Data Loader Process Configuration Parameters Parameter Name Data Type Equivalent Option in Settings Dialog Description • If an incorrect value is entered. Phone.0 and later. the load operation fails for the row if a value is specified that is too large for the field. update. Multi-select Picklist.lang. and Text (Encrypted). Select this option to direct the Data Loader to truncate data in the following types of fields when loading that data into Salesforce: Email.0 and later. See also sfdc.getDefault() method in Java.0 and earlier. or a custom ID such as GMT-8:00. Picklist. values for fields of those types are truncated by the Data Loader if they are too large. Selecting this option allows you to specify that the previous behavior. sfdc.

Delete Loads data from a data source into Salesforce. then writes the exported data to a data source. records without matches are inserted as new records. 30 . several operations are supported. which you use to extract data directly from a database.password on page 28. Hard Delete Loads data from a data source into Salesforce. Update Loads data from a data source into Salesforce.username string N/A Sample value: jdoe@mycompany. use \samples\conf\database-conf. Soft-deleted records are not included. An operation represents the flow of data between Salesforce and an external data source such as a CSV file or a database. including both existing and soft-deleted records. then writes the exported data to a data source.Running Batch Processes Data Loader Command Line Operations Parameter Name Data Type Equivalent Option in Settings Dialog Description Sample value: true Salesforce username. Upsert Loads data from a data source into Salesforce. Insert Loads data from a data source into Salesforce as new records.xml to configure database access objects. where existing records with matching ID fields are deleted.com Data Loader Command Line Operations When running the Data Loader in batch mode from the command line. where existing records with a matching custom external ID field are updated. Configuring Database Access When you run the Data Loader in batch mode from the command line. Extract Uses a Salesforce Object Query Language (SOQL) string to export a set of records from Salesforce. where existing records with matching ID fields are updated. sfdc. See sfdc. Extract All Uses a Salesforce Object Query Language (SOQL) string to export a set of records from Salesforce. See the following list of operation names and descriptions. where existing records with matching ID fields are deleted without being stored first in the Recycle Bin.

internal.jdbc.dbcp.dbcp. DatabaseConfig Example <bean id="AccountInsert" class="com. additional information may be required.apache.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@myserver. username The username for logging in to the database. It contains the following properties: driverClassName The fully qualified name of the implementation of a JDBC driver. dataSource The bean that acts as database driver and authenticator.database.apache.dataloader.dao.com:1521:TEST"/> <property name="username" value="test"/> <property name="password" value="test"/> </bean> 31 .commons.dbcp.sql.commons. password The password for logging in to the database.BasicDataSource. url The string for physically connecting to the database.driver.DatabaseConfig" singleton="true"> <property name="sqlConfig" ref="accountInsertSql"/> </bean> DataSource The DataSource bean sets the physical information needed for database connections.BasicDataSource when database connections are pooled.apache.salesforce.commons. which has the following properties: sqlConfig The SQL configuration bean for the data access object that interacts with a database.DataSource such as org. use org.salesforce. DataSource Example <bean id="oracleRepDataSource" class="org.Running Batch Processes Configuring Database Access DatabaseConfig Bean The top-level database configuration object is the DatabaseConfig bean. It must refer to an implementation of javax. For example.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="oracle. Depending on your implementation.

They can implement a read interface (DataReader). see the official documentation and the support forums. For more information on the Spring Framework. databaseRead Allows the reading of a database. databaseWrite Allows writing to a database.dataloader. several data access objects are supported.salesforce. As shown in the code samples below. class Specifies the implementation class for the bean instance. 32 .SqlConfig and have the following properties: sqlString The SQL code to be used by the data access object. csvWrite Allows writing to a comma or tab-delimited file. For more information. For more information.xml to configure database access. which is the class that gets objects from an XML configuration file. the parameters correspond to each object's setter methods. A header row is added to the top of the file based on the column list provided by the caller. Use database-conf. the SqlConfig class contains configuration parameters for accessing specific data in the database. Use database-conf. See the following list of object names and descriptions.database.dao. a write interface (DataWriter). or both. The bean must be of type com. Note that salesforce. Each bean represents an instance of an object.Running Batch Processes Configuring Database Access Spring Framework Overview The Data Loader configuration files are based on the Spring Framework. see Configuring Database Access on page 30. queries and inserts are different but very similar. csvRead Allows the reading of a comma or tab-delimited file. A typical bean has the following attributes: id Uniquely identifies the bean to XmlBeanFactory. There should be a header row at the top of the file that describes each column. Data Access Objects When running the Data Loader in batch mode from the command line. A data access object allows access to an external data source outside of Salesforce. which is an open source full-stack Java/J2EE application framework. SQL Configuration When running the Data Loader in batch mode from the command line. The Spring Framework allows you to use XML files to configure beans.com cannot guarantee the availability or accuracy of external websites. see Configuring Database Access on page 30.xml to configure database access.

PARTY_ID = accounts. parties. Replacement parameters must be delimited on both sides by “@” characters. locs.Date instead of java. For more information. ar.hz_organization_profiles org.PARTY_ID and parties.hz_cust_accounts accounts.city. locs.PARTY_ID = org.postal_code. @process.lastRunDate@. SQL Query Bean Example <bean id="accountMasterSql" class="com.dataloader. accounts. ar.LOCATION_ID and (locs.Date. concat (concat(parties. parties.SqlConfig" singleton="true"> <property name="sqlString"/> <value> SELECT distinct '012x00000000Ij7' recordTypeId. such as java. Note that “java.util. locs.sic_code from ar. Contains column names for the data outputted by executing the SQL.last_update_date > @process.hz_party_sites party_sites.lastRunDate@ </value> </property> <property name="columNames"> <list> <value>recordTypeId</value> <value>account_number</value> <value>organization_name</value> <value>billing_address</value> <value>city</value> <value>postal_code</value> <value>state</value> <value>country</value> <value>sic_code</value> </list> </property> <property name="sqlParams"> 33 . ar.address1.state. For example.address2) billing_address. Each entry represents one replacement parameter: the key is the replacement parameter's name. see the official JDBC API documentation.dao.LOCATION_ID = party_sites.salesforce. columnNames Used when queries (SELECT statements) return a JDBC ResultSet.database.hz_parties parties. ar.account_number. sqlParams A property of type map that contains descriptions of the replacement parameters specified in sqlString.PARTY_ID and party_sites.hz_locations locs where accounts.last_update_date > @process.country.organization_name.PARTY_ID and locs. org.Running Batch Processes Configuring Database Access The SQL can contain replacement parameters that make the string dependent on configuration or operation variables.PARTY_ID = accounts.sql. The column names are used to access and return the output to the caller of the DataReader interface. ' '). locs.sql” types are sometimes required. the value is the fully qualified Java type to be used when the parameter is set on the SQL statement.lastRunDate@ OR accounts.

lastRunDate" value="java. In your configuration file. Put the data source on the left. 3. 2.INT_PARTIES ( BILLING_ADDRESS.sql. an equals sign (=) as a separator. Surround constants with double quotation marks.mappingFile to specify the name of your mapping file.lang. Observe the following syntax: • • • • • On each line. and the destination on the right.dataloader.Running Batch Processes Mapping Columns <map> <entry key="process. as in "United States"=BillingCountry.lang. Values without quotation marks are treated as column names.salesforce.Date"/> </map> </property> </bean> SQL Insert Bean Example <bean id="partiesInsertSql" class="com. Data sources can be either column names or constants. you must create a properties file that maps values between Salesforce and data access objects. Column Mapping Example for Data Insert The Salesforce fields are on the right. use the parameter process. 1.database. SLA__C=SLA__c BILLINGCITY=BillingCity SYSTEMMODSTAMP= OWNERID=OwnerId CUSTOMERPRIORITY__C=CustomerPriority__c ANNUALREVENUE=AnnualRevenue DESCRIPTION=Description 34 . @sic_code@) </value> </property> <property name="sqlParams"/> <map> <entry key="billing_address" value="java. SIC_CODE) VALUES (@billing_address@.String"/> </map> </property> </bean> Mapping Columns When running the Data Loader in batch mode from the command line.String"/> <entry key="sic_code" value="java. as in “sampleconstant”.dao. Create a new file. You may map constants by surrounding them with double quotation marks. pair a data source with its destination.SqlConfig" singleton="true"> <property name="sqlString"/> <value> INSERT INTO REP. Destinations must be column names.

Unlimited.1 35 . copy process-conf.xml from \samples\conf.org/licenses/LICENSE-1..xml.org/licenses/LICENSE-1. copy database-conf. If your process requires database connectivity. Copy config.bat.apache.xml from \samples\conf.6 License http://www. create a new directory and add the following files to it: • • • If your process is not interactive./conf accountMasterProcess Note: You can configure external process launchers such as the Microsoft Windows XP Scheduled Task Wizard to run processes on a schedule. Id=account_number Name=name Phone=phone Running Individual Batch Processes To start an individual batch process use \bin\process.Running Batch Processes Running Individual Batch Processes BILLINGSTREET=BillingStreet SHIPPINGSTATE=ShippingState Column Mapping Example for Data Export The Salesforce fields are on the left.properties from \conf. Data Loader Third-Party Licenses Available in: Enterprise. and Developer Editions The following third-party licenses are included with the installation of the Data Loader: Technology Axis Ant Apache Jakarta Commons BeanUtils Version Number 1. A process name The name of the ProcessRunner bean from \samples\conf\process-conf.1 http://www. Process Example process .apache.1 1. To use an alternate directory. which requires the following parameters: A configuration directory The default is \conf.

2.6R2 1.2.eclipse.5.8 3.apache.opensymphony.html http://www.txt http://www.3 License http://jakarta.apache.1 1.6 Note: salesforce.org/licenses/LICENSE-2.0.html http://www.com/quartz/license.org/commons/license.1 1.apache.apache.2 Library Apache Log4j Eclipse SWT 1.org/commons/license.com is not responsible for the availability or content of third-party websites.mozilla.org/org/documents/epl-v10.html http://jakarta.2.html http://www.Running Batch Processes Data Loader Third-Party Licenses Technology Apache Commons Collections Apache Commons Database Connection Pooling (DBCP) Apache Commons Logging Version Number 3. 36 .org/licenses/LICENSE-2.063 OpenSymphony Quartz Enterprise 1.0.0.apache.txt Apache Commons Object Pooling 1.org/commons/license.html http://jakarta.org/commons/license.apache.action http://www.html http://jakarta.1.1 Job Scheduler Rhino JavaScript for Java Spring Framework 1.org/MPL/MPL-1.

8. 16 column mapping 34 command line interface 20 command line operations 30 config. 8 Spring Framework 32 starting batch processes 35 system requirements 3 third-party licenses 35 troubleshooting 18 uninstalling 8 uploading 16 uploading attachments 15 using 7 when to use 2 B Bulk API 4. 8 uploading attachments 15 D Data Loader attachments 8 batch files 19 batch mode 18 batch mode parameters 22 Bulk API 4.properties 22 configuring 4. 7. 8 S Spring Framework.Index Index A Apex Data Loader See Data Loader 1 Data Loader (continued) configuring batch processes 21 data types 9 date formats 9 installed files 19 installing 3 overview 1 password encryption 19 sample files 19 settings 7. see Data Loader 32 37 .

Sign up to vote on this title
UsefulNot useful