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

and actions in files used for automated processing. When importing data. mappings. see the following topics: • • When to Use the Data Loader Installing the Data Loader 1 . 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. we encourage you to use Data Loader on Windows 7 instead. When you set up batch processes through the command line.DATA LOADER Data Loader Overview Available in: Enterprise. delete. data sources. Note: If commas are not appropriate for your locale. When you use the user interface. Unlimited. it outputs CSV files. you specify the configuration. extracts. or set up automated batch processes launched from the command line. you work interactively to specify the configuration parameters. Note: If you are currently using Windows 2000. When exporting data. To get started. and Developer Editions The Data Loader is a client application for the bulk import or export of data. 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. CSV files used for import and export. You can use Data Loader interactively through its user interface. an open source version of Data Loader is available here. or export Salesforce records. and the field mappings that map the field names in your import file with the field names in Salesforce. Use it to insert. use a tab or other delimiter. and loads data from comma separated values (CSV) files or from a database connection. update. the Data Loader reads.

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

Installation Procedure Caution: Over time.5 or later (Windows XP or Windows 7). However. for example. 90 MB free disk space. 3 . Note: If you are currently using Windows 2000. 4.” You can run different versions at the same time on one computer. click Your Name ➤ Setup ➤ Data Management ➤ Data Loader. Sun JVM 1.Installing and Configuring the Data Loader Installing the Data Loader INSTALLING AND CONFIGURING THE DATA LOADER Installing the Data Loader Available in: Enterprise. multiple versions of the Data Loader client application have been available for download. we encourage you to use Data Loader on Windows 7 instead. 3. 2. Some versions were released with earlier product names such as “AppExchange Data Loader” or “Sforce Data Loader. Double-click the downloaded file to launch the InstallShield wizard. You can run the Data Loader wizards or run the application from the command line. Java JRE 1. 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. 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. do not install multiple copies of the same version. Accept the license agreement and click Next. 5. you need: • • • • • Windows 7 or Windows XP. Unlimited. 1. first remove it from your computer by using the Add or Remove Programs dialog in the Windows Control Panel. In the online application. 256 MB available memory. Click Next. If you have previously installed the latest version and want to install it again.5 or later (Windows XP or Windows 7). 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.

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

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

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

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. Click OK to save your settings. However. 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 username for proxy server authentication. Empty field values are ignored when you update records using the Bulk API. there are some differences in behavior in Data Loader when you enable the Bulk API. 7 . or a custom ID such as GMT-8:00. Start at row 4. For more information. To set a field value to null when the Use Bulk API option is selected. Allow field truncation This option directs Data Loader to truncate data for certain field types when the Bulk API is disabled. use a field value of #N/A. 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. 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. One important difference is that it allows you execute a hard delete if you have the administrative permission and license. The password for proxy server authentication. Data Loader Behavior with Bulk API Enabled Available in: Enterprise. The name of the Windows domain used for NTLM authentication. If your last operation failed. Proxy Host Proxy Port Proxy Username Proxy Password Proxy NTLM domain The host name of the proxy server. if applicable. The proxy server port. Unlimited.

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

see Uploading Attachments on page 15 and Uploading Content with the Data Loader on page 16. “true”. “0” Date Formats We recommend you specify dates in the format yyyy-MM-ddTHH:mm:ss. “1” False values (case insensitive) = “no”.SSSPacific Standard Time yyyy-MM-dd'T'HH:mm:ss. For more information. “n”.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.SSSGMT-08:00 yyyy-MM-dd'T'HH:mm:ss. “y”. and Developer Editions Data Loader supports the following data types: Base64 String path to file (converts the file to a base64–encoded array). “false”.SSS-800 yyyy-MM-dd'T'HH:mm:ss 9 . Base64 fields are only used to insert or update attachments and Salesforce CRM Content.SSS -800 yyyy-MM-dd'T'HH:mm:ss. “off ”. Unlimited.SSS GMT-08:00 yyyy-MM-dd'T'HH:mm:ss.SSS PST yyyy-MM-dd'T'HH:mm:ss. “on”.SSSPST yyyy-MM-dd'T'HH:mm:ss.SSS'Z' yyyy-MM-dd'T'HH:mm:ss. Boolean • • True values (case insensitive) = “yes”.SSS Pacific Standard Time yyyy-MM-dd'T'HH:mm:ss.Using Data Loader Data Types Supported by the Data Loader USING DATA LOADER Data Types Supported by the Data Loader Available in: Enterprise.

select the Use European date format box in the Settings dialog. Integer Standard integer string String All valid XML strings. European date formats aredd/MM/yyyy and dd/MM/yyyy HH:mm:ss. The earliest valid date is 1700-01-01T00:00:00Z GMT. or just after midnight on January 1. Tip: To ensure data quality.” Only dates within a certain range are valid. the earliest valid date is 1699-12-31T16:00:00. Note: These values are offset by your timezone. 1700. 1699. • 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. A knowledge base solution for this issue is available in the Salesforce Help & Training window. search for “data loader date. or just after midnight on December 31. 4000. we recommend that you change your computer setting to GMT in order to avoid date adjustments when inserting or updating records.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. or 4:00 PM on December 31. If your computer's locale is east of Greenwich Mean Time (GMT). invalid XML characters are removed. make sure that all Salesforce IDs you enter in the Data Loader are in the correct case. For example. 10 . in the Pacific timezone. The latest valid date is 4000-12-31T00:00:00Z GMT.

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

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

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

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

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

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

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

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 . The two log files are: sdl. such as logging in to Salesforce. you can access log files that track the operations and network connections made by the Data Loader. or if requested by salesforce.log.log and %TEMP%\sdl_out. These files can be opened with commonly available text editor programs. RUNNING BATCH PROCESSES Running in Batch Mode You can run the Data Loader in batch mode from the command line. Log entries marked “INFO” are procedural items.log A supplemental log that contains additional information not captured in sdl. If you are having login issues from the UI.log Contains a detailed chronological list of Data Loader log entries. Log entries marked “ERROR” are problems such as a submitted record missing a required field.Running Batch Processes Troubleshooting Data Loader Operations Troubleshooting Data Loader Operations Available in: Enterprise. If you are having login issues from the command line. you may need to obtain a new security token. it includes log entries for the creation of proxy server network connections. and Developer Editions If you need to investigate a problem with the Data Loader. ensure that the password provided in the configuration parameters is encrypted. sdl_out. You can quickly open these files by entering %TEMP%\sdl. such as Microsoft Notepad. For example.com Customer Support.log in either the Run dialog or the Windows Explorer address bar. Unlimited.

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

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

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

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

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

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

process. We recommend a value of 5000.bulkApiCheckStatusInterval integer N/A Sample value: 5000 Select this option to use serial instead of parallel processing for the Bulk API.bulkApiZipContent boolean sfdc.connectionTimeoutSecs integer N/A Sample value: 60 25 . updates.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. Processing in parallel can cause database contention.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.useEuropeanDates boolean sfdc. Note that using this option may significantly increase the processing time for a load. Using serial mode guarantees that batches are processed one at a time. and upserts. See also sfdc. and upserts on cases and leads. Sample value: false sfdc.useBulkApi. the load may fail. sfdc.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. Sample value: true The number of seconds to wait for a connection during API calls. See also sfdc. such as Attachment records or Salesforce CRM Content. It also applies to updates on accounts if your organization has territory assignment rules on accounts. When this is severe. Sample value: true Specify the ID of the assignment rule to use for inserts. See also sfdc. sfdc.useBulkApi. The assignment rule overrides Owner values in your CSV file.useBulkApi. updates. This option applies to inserts.

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

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

username on page 30. sfdc.com sfdc.internal. Sample value: 4285b36161c65a22 The host name of the proxy server. sfdc.proxyUsername string Sample value: jane. sfdc.timeZone string Time zone 28 . • If no value is specified. sfdc.proxyHost URL Proxy Host Sample value: http://myproxy.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. 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. if applicable. disable this option. the value specified here is used.password encrypted string N/A An encrypted Salesforce password that corresponds to the username provided in sfdc. Salesforce resets the URL after login to the one specified in sfdc.proxyPassword encrypted Proxy string Password Proxy Port Proxy Username An encrypted password that corresponds to the proxy username provided in sfdc.company.endpoint.To turn off this automatic reset.timeoutSecs integer Timeout Sample value: 540 If a date value does not include a time zone.doe By default. sfdc.proxyUsername on page 28.proxyPort integer Sample value: 8000 The username for proxy server authentication. See also Encrypting From the Command Line on page 19. Sample value: 4285b36161c65a22 The proxy server port.

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

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

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

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

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

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

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

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

7. 16 column mapping 34 command line interface 20 command line operations 30 config. 8 uploading attachments 15 D Data Loader attachments 8 batch files 19 batch mode 18 batch mode parameters 22 Bulk API 4. see Data Loader 32 37 . 8 S Spring Framework.properties 22 configuring 4. 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.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.

Sign up to vote on this title
UsefulNot useful