We are doing Salesforce (old instance) to Salesforce (new instance) migration. We have Standard and custom objects in our old instance which are needed 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.


1 Answer 1


You can use the composite sobject rows if you do not have a large payload of the order of 100K


A single request can take 200 records so you will group the requests in this approach.

Another way is to use the new graph composite api.

This api is available as of today from winter 21

You can find details below


Work your payload so as to avoid the limits mentioned below.


This api can have 500 subrequests and hence is more powerful than simple composite api

Use a bulk API for large payloads of the order of millions.


You can get the processed IDs using the below API for bulk jobs


  • Bulk api batch results do not return newly created Id in destination org which we need to update in child records. Composite API return newly created Id with reference Id (which is old id, so that we can update child object in MySQL before sending them). Composite API have limit of 200 records in single request.
    – Amit Kumar
    Oct 17, 2020 at 20:47
  • @amit Results do return response once job is processed! You have to call the right api Oct 17, 2020 at 20:54
  • Thanks, @Mohith Shrivastava,
    – Amit Kumar
    Oct 18, 2020 at 8:36
  • We have a total of 100 objects (20 standard, 80 custom) which are needed to be migrated. Most of them are related to other objects with parent-child relationships.So if we use bulk api which are asynchronous in nature, so it can take some time to complete (which may vary).
    – Amit Kumar
    Oct 18, 2020 at 8:40

You must log in to answer this question.

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