I have changed the structure of my salesforce database and now I need to migrate the data. I was just wondering which tool is the best one to use or which technique also, because I need to migrate data from 2 related object.

I have:

Opportunity: Detail Number

Contract: Contract Number

So, an opportunity can have many contracts, and I need to extract the relationship between the Contract Number and the Detail Number on Opportunity.

I have a query for that:

'SELECT Detail_Number__c (SELECT Contract_Number__c FROM Contract__r) FROM Opportunity'

This should give me all the Contracts that are related to the opportunity, right?

My new structure is as follows. I have removed the Detail Number from Opportunity, and we hold it on Contract instead now.

Contract --> ContractDetailNumbers <-- DetailNumber

I have created an object to hold the detail numbers and a junction object, because a contract can have more than one detail numbers.

So, I assume I will just insert all the detail numbers into DetailNumber and then create the junction objects from the file that I extracted earlier.

Would that be the best way of doing this? Which tool would you use?


4 Answers 4


Assuming there's a Contract look-up field on Opportunity: I would use the Salesforce Data Loader to export the Opportunity Id, Detail Number and related Contract. Next, I would use the Salesforce Data Loader to insert the Export-records as ContractDetailNumbers-records. You'll have to map the columns to the right fields on the ContractDetailNumbers-object.

You can find more about the Data Loader here: https://developer.salesforce.com/page/Data_Loader

  • There is no lookup field on opportunity because contract is a related list on opportunity.
    – Lily
    Jan 5, 2015 at 12:19
  • In that case you will have to do two exports using the Data Loader: First, you need to Export all Contracts to get the Contract IDs and matching Opportunity IDs. Then, you need to get all Opportunity IDs and matching Detail Numbers. You can then match Opportunity IDs from the first export with the second export in Excel, using the VLOOKUP function. Jan 5, 2015 at 12:22

Assumption 1: The DetailNumber on Junction object is a text/numeric field
1) Export all the Contacts records with ContractID, Opportunity.DetailNumber.
2) Use this file to insert records of the junction object

Assumption 2: DetailNumber is a lookuop to opportunity
1) Export all contract records with ContractID, OpportunityID
2) Use this file to insert records of the junction object

PS. You can use report to get the data of the related opportunity detail number.


Create a report containing the data you want to move and then use syncfrog to move it. It can pass your data to multiple objects in one go and do some (limited) transformation at the same time.



Others have mentioned Data Loader and Syncfrog as possible tools for this project. I believe DemandTools and Jitterbit could also be used. I have experience with DemandTools, but none with Jitterbit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .