You are on page 1of 27

Data Management

Deloitte Consulting LLP


5/26/15

Contents

Data

Loader Introduction and Features


Data Loader Installation
Using Data Loader for:
SOQL Salesforce Object Query Language
SOSL Salesforce Object Search Language
Data Loader - Command Line Interface
Import

Wizard Introduction and Features


Import Wizard v/s Data Loader
Accessing Import Wizard
Workbench

Tool
SOQL Using Workbench
and Don'ts in Migration
Best Practices Data Loader

-2-

ril'14 Training Material Template (4).pptx

Dos

Data Loader Introduction and Features


The Data Loader is a Java based client application for the bulk import or export of data.
Use it to insert, update, upsert, delete or extract records.

The Data Loader can move data into or out of any type of record. When importing data, it reads, extracts, and loads data from comma separated
values (CSV) files. When exporting data, it outputs CSV files.

An easy-to-use wizard interface.

An alternate command line interface

A batch mode interface with database connectivity

Support for larger files with up to millions of rows.

Drag-and-drop field mapping

Support for all objects, including custom objects.

Detailed success and error log files in CSV format.

A built-in CSV file viewer.

-3-

ril'14 Training Material Template (4).pptx

The Data Loader offers the following key features:

Data Loader Installation


To Download, click Setup | Data Management | Data Loader.

You need to load 50,000 or more records.

You need to load into an object that is not yet supported by webbased importing.

You want to schedule regular data loads, such as nightly


imports.

You want to be able to save multiple mapping files for later use.

You want to export your data for backup purposes.

-4-

ril'14 Training Material Template (4).pptx

Use the Data Loader when:

Using Data Loader Login


Use
User Name
Password
Security Token

Click Setup | My Personal Information |


Reset Security Token, and click the
Reset Security Token button. The new
security token is sent via email to the
email address on your user record.

Append the Security Token to your


password while logging into Data Loader.

-5-

ril'14 Training Material Template (4).pptx

To Login to Data Loader.

Using Data Loader Configuration


Configure the following properties in Data
Loader through the settings tab.

Batch Size

Insert Null Values

Assignment Rule

Server Host
test.salesforce.com Sandbox

Reset URL on Login

Timeout

Query Request Size

Generate success files for exports

Read & Write all CSVs with UTF-8 encoding

Use European Date Format

Use Bulk API

Proxy settings

Start at row

-6-

ril'14 Training Material Template (4).pptx

login.salesforce.com Production

On receiving the Meta Data Documents for the Legacy System map them with the Force.com Meta Data/
Objects-Fields.

Verify the same before performing any Migration Task, to ensure correctness.

Prepare the Load data using these Mapping Documents.

While migrating prepare the mapping document using Data Loader and store them for future references.

Data Loader provides two types of mapping

Auto-Mapping

Manual Mapping

-7-

ril'14 Training Material Template (4).pptx

Using Data Loader Mapping

Using Data Loader Tracking Success and Errors

Always record the Success- Error Files for any Migration task performed to evaluate the performance of the migration
task .

These success-error files can be used as references in future for any migration task performed for the same client.

When encountering errors check the error message on the error files. Rework on the same and perform the Migration
task again.

Click on the Browse Button to select the folder where


you would like to save you Error & Success Files.
These files show you the List of Errors and
Successes in Upload.

-8-

ril'14 Training Material Template (4).pptx

Click OK & Click Finish

Using Data Loader Queries for Export

Select statements

Conditions in Select statements

IN

Equals

Contains

Not Equals

Like

Starts With, Ends With

>, < , >=, <=

-9-

ril'14 Training Material Template (4).pptx

Writing SOQL queries on objects:

Upsert Use of External IDs


External ID is flag that can be added to a custom field to indicate it should be indexed and treated
as an ID.
Custom index on any custom field of type: Text, Number or Email.
Available on all objects that support custom fields
User-defined cross-reference field
An object can have atmost seven external ID fields

Upsert is an API function that combines insert and update into a single call.

Upsert uses an indexed custom field or external ID to determine whether to create a new object or
update an existing object

Upsert is used when importing data to prevent the creation of duplicates.

- 10 -

ril'14 Training Material Template (4).pptx

CLI of Data Loader is used when a process is desired to be automated because the GUI
form of Data Loader requires human interaction to accomplish the tasks.

Command Line Interface of Data loader executes the data loader from the command
line.

It can perform all the operations that the GUI version is capable of like insert, update,
upsert, delete & export data. Additionally, it can also move data to and from a commaseparated variable file (.csv) to and from a relational database, such as Oracle or SQL
Server, that has a standard JDBC driver

- 11 -

ril'14 Training Material Template (4).pptx

Data Loader Command Line Interface (CLI)

Requirements for CLI Execution

Data loader to be installed.

Java Runtime Environment (JRE) v1.4.2_03 or above.

Install a database such as Oracle or SQL Server in case a staging environment is


needed to perform transformations on the data.

JDBC driver in the class path to connect to the database installed.

process-conf.xml

database-conf.xml
(The XML files can be found at :

- 12 -

ril'14 Training Material Template (4).pptx

C:\Program Files\salesforce.com\Apex Data Loader version \samples\conf )

Import Wizard Introduction and Features


The Import Wizard provides a unified interface that lets you import some standard objects.
The wizard also lets you import custom objects.
Use the Import Wizard when:
You are loading less than 50,000 records.
The object you need to import is supported by import wizards. To see what import wizards are available
and thus what objects they support, from Setup, click Data Management.

- 13 -

ril'14 Training Material Template (4).pptx

You want to prevent duplicates by uploading records according to account name and site, contact email
address, or lead email address.

If you want to..

Import Wizard

Apex Data Loader

Import less than 50k records

Receive alerts for duplicates

Invoke workflow rules on import

Schedule Imports

Save mappings for later use

Export data

Load into Opportunities or Products

- 14 -

ril'14 Training Material Template (4).pptx

Import Wizard v/s Data Loader

Accessing Import Wizard


For Records You Own
To access import wizards for records you personally own, go to your personal settings and select Import.

For Your Organization's Records

- 15 -

ril'14 Training Material Template (4).pptx

To access import wizards for organization-wide data, from Setup, select Data Management.

Using Import Wizard Step 1

- 16 -

ril'14 Training Material Template (4).pptx

Before selecting the file to be imported, the CSV file has to follow a certain format, depending on the
object type being imported. Given below is an example for contacts.

Using Import Wizard Step 2

- 17 -

ril'14 Training Material Template (4).pptx

After the format of the CSV file is as desired, the user is allowed to specify the following parameters
for the import.

Using Import Wizard Step 3

- 18 -

ril'14 Training Material Template (4).pptx

The next step is to select the operation that is to be performed, i.e. insert, update or upsert.

Using Import Wizard Step 4

- 19 -

ril'14 Training Material Template (4).pptx

The next step is to select which user field is included in the .csv to designate the record owners. Next you
upload the .csv

Using Import Wizard Step 5

- 20 -

ril'14 Training Material Template (4).pptx

The final step is to edit the field mapping. Some fields will be already mapped; for the other fields you can
map manually.

Workbench Tool
Powerful web-based suite of tools designed for administrators and developers to interact with
Force.com organizations via the Force.com APIs
Users can describe, query, manipulate, and migrate both data and metadata in Force.com organizations

- 21 -

ril'14 Training Material Template (4).pptx

directly in their web browser with a simple and intuitive user interface

- 22 ril'14 Training Material Template (4).pptx

Accessing Workbench

- 23 ril'14 Training Material Template (4).pptx

SOQL Using Workbench

Data Migration Dos and Donts


Dos

Always take a backup of the System


data before starting the migration
activities, to revert back in case of
issues.

Dont start migration without


planning the migration strategy.
First , identify the order for
migrating the objects.

Always record Mapping Documents,


Load Data and Success-Error Log.

Dont open the system to public


while performing migration.

Track the Workflow Rules, Validation


Rules and Triggers tagged to Objects
and Inactivate them

Dont forget to activate the


Workflow Rules, Validation Rules
and Triggers once Migration is
complete.

Dont migrate fields like Phone No.,


Date Fields etc without formatting
the same into Force.com format, to
avoid inconsistency in data.

While performing voluminous


Load to speed up the migration
process
To avoid errors relating to specific
needs of the business

- 24 -

ril'14 Training Material Template (4).pptx

Donts

Best Practices Data Loader

EXTRACT /DATA Stores the source data from one or more Legacy Database/Force.com.

MAPPING Stores the mapping files for each object whose records are to be migrated to
Force.com.

LOAD Stores the final copy of the files to be uploaded into Force.com generated after the
transformations(if required) on the source data is complete.

STATUS (SUCCESS-ERROR) Stores the success & error files of each migration task performed
per object.

BACKUP Maintains the backup copy of the data in the target org.

- 25 -

ril'14 Training Material Template (4).pptx

Basic folder structure for performing any Data Migration:

- 26 ril'14 Training Material Template (4).pptx

QnA

- 27 -

ril'14 Training Material Template (4).pptx

Copyright 2012 Deloitte Development LLC. All rights reserved.

You might also like