In this blog I am going to explain briefly about how to Export data from one Salesforce Org to another Org and Import data to a Salesforce Org from another org using dataloader.io.
What is dataloader.io?
- A web-based tool to import data to Salesforce.com from another org.
- Used to export information from Salesforce.com to another org.
- Helps to delete information from Salesforce.com.
How to Export Account Records from an Org
First, let’s see how we can export account records from an Org with an example.
Step 1: On the dataloader.io link, click the “Login with Salesforce” button and you will be taken to the next page.
Step 2: According to your requirements, choose your preferred environment for logging in – it can be either Sandbox or Production.
Step 3: In order to Export a record from Salesforce we have to follow these steps:
Select New Task → Export. It will lead to the new window.
Step 4: Choose the object record to be exported. With this example, I will show you how to Export Account Records.
Step 5: In this example I am going to fetch Account records by the fields Account ID, Account Name and Annual Revenue
Filters for this would be for “Annual Revenue” that is greater than 10000 ie: Account having an Annual Revenue greater than 10000 will be filtered and those account records will be fetched from the org.
Sorting is done in Ascending order of Annual Revenue, and then click Next.
SOQL Query is to Query the records by selected fields, filters and sorting.
Step 6: These steps give the details of records that matches the query above. Here we have 17 records to be exported from the Account Object.
Schedule Task: We can schedule the task Hourly, Daily, Weekly and Monthly. This will generate the list of records to our selection in the Schedule Task. Once this is done, Click Save & Run.
Step 7: By clicking on “17 Success” you get access to the list of records. An excel sheet is generated with the Account records that we sorted above in a CSV file.
Step 8: Final Output reveals the Account ID, Account Name & Annual Revenue.
How to Export Entire fields of Account & Contact Records?
In this example, we will see how all the Accounts and Contacts from the Existing Org can be exported and then imported to the new Org. In order to export all the fields of Account and Contacts, click the “Select all” checkbox in the top right corner of “Fields” tab.
Final Result: This will give us the total number of Accounts (27)and Contacts (32) records that we have in our Org. In the “Advanced” tab, select the date to export the data. An excel sheet is generated with the list of Accounts and Contacts.
How to Insert these Accounts and Contacts into the New Org
For this, we need the excel sheet that contains the list of Account and Contact Records that was taken from the Old Org in a CSV format.
Step 1: Select New Task → Import
Step 2: Select Account
Step 3: From here, upload the CSV of Account that was generated from the Old Org and click Next.
Account Insert: This will show the count of Account records in the CSV. Click Save & Run.
Final Output: Insertion of Account
Before inserting Contact, the Contact and Account have to be mapped and only then can the Account and Contact from the Old Org relate in the New Org too. For this, pass the Account Id taken from the Import of Account into the New Org ie the account ID accessed from the CSV file while importing.
In order to map a Contact with Account, create a column in the Contact CSV as Account ID.
Here, I am mapping just four Contacts with the Accounts. If we pass the Account Id for the related Contacts, the Account will be automatically related to Contact.
The Contacts and Accounts will be automatically associated as shown below.
How to Insert Contacts
In Order to Insert Contacts we have to select “Insert” and select “Contact” object. Then, we will get the total number of Contact records.
Final Output: Contact Insert
This will insert a list contacts and it will automatically relate to Account (only for the already mapped four Contacts).
Do you have any more tried-and-tested suggestions on how this can be done? Feel free to drop a comment below and contribute.