0
votes

We are doing Salesforce (old instance) to Salesforce (new instance) migration. We have Standard and custom objects in our old which are need to be migrated to the new Salesforce instance. We are doing this in the following steps:-

1: Using salesforce describe rest api create tables in MySQL with similar mapping of salesforce object. Tables are created with referential integrity using "referenceTo" field of describe call. Example: services/data/v49.0/sobjects/User/describe/.

2: Get data from salesforce using query rest api and put into MySQL tables. Example: /services/data/v39.0/query/?q=.

3: In this part, we have some confusion like which api we should use so that we can push records to destination org.

We are using Python for this task.

3

3 Answers

1
votes

Although your approach is not exactly best practice, to answer your question, you should use the Bulk API to push the record data into new org (assuming you have lots of data). There are also lots of backup/restore vendors out there that you could have just used like Ownbackup, Odaseva, Backupify, Grax

1
votes

If it's a one-time process (only migration), then go with the any of the data management tool:

  • Data Import wizard
  • Data Loader
  • DataLoader.io
  • workbench

All the above-mentioned tool are free and has a variety of features.

Steps to import:

  1. Export all the data from the old org.
  2. Now determine the order of insertion based on the object relationship field:

if objects have relation in between, start with Importing the parent records first.

if there are child records, map the new id of the parent by applying v-lookup between the parent success sheet and child record sheet.

repeat step 2, until you end up with migration of all records.

FYI: If the records for the objects are less than 50k, then go with the inbuild import wizard it can give you more control on controlling workflows and process triggering which other tools would not.

0
votes

For this kind of migration I would recommend to use an Bulk Api migration and an inbuild tool now, if you really need to migrate via SQL since you will be doing complex data transformation prior insertion use an specific API connect tool such as DBAmp.

I would love to know which objects you need to migrate, you are saying standard, but there are some that you can migrate simply enough others are more complex, like chatter, knowledge, attachments (contentVersion or ContentDocument)

There are some tools that you could consider like Magic Mover Magic Mover for Notes And Attachments to Lightning Experience By Salesforce Labs

Honestly using Python will only make it way more complicated and painful.