Assuming metadata is already identical, the data-transfer of complex models can still take hours or even days of manual work.
Fortunately there are free tools like TalenD which can help to automate the process as described here Copying data to Salesforce Sandboxes using TalenD by @codeulike - I worked through the example and it works fine. Still it's a huge piece of work, but at least, the outcome is repeatable and the second run goes with one click.
Like doing it manually, the challenge are the references. To build up proper references you have to create muiltiple jobs in the right order, like this:
- first Users, then Accounts, then Contacts, then Opportunities, ...
Now I come to the point of self references or other kinds of cyclic relations... Let's take a simple example like Account.ParentId. I think the basic approach goes like this:
- in a first subjob upsert the accounts with empty Account.ParentId
- in a second subjob update the account with the right "Relationship management for upsert" in the "Advanced settings" at the tSalesforceOutput component
My questions are:
- can it be done easier? Maybe in a single subjob?
- is there a best practice approach to solve self-references and cycles?
- assume we can only migrate a subset of Accounts due to capacity limits of the target org. We have to make sure that Parents are automatically fetched. Is there an smart approach for a "Query Condition" for tSalesforceInput or any other trick to add all parents automatically to an filtered subset of all Accounts?
- is there a way in talend to automate this dependency-layering-process and make it somehow a bit repeatable for different orgs and schemas?