function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GaceGace 

How to migrate million records from one org to another?

I need to migrate million records from one org to another using REST API. How can i do that without limits exceeding? Or should i use BULK API and how must it work?
Best Answer chosen by Gace
SwethaSwetha (Salesforce Developers) 
HI Gace,
I see you also posted on https://salesforce.stackexchange.com/questions/405599/how-to-migrate-million-records-from-one-org-to-another and I've suggested trying PK Chunking to Extract Large Data Sets from Salesforce

Documentation: https://developer.salesforce.com/blogs/engineering/2015/03/use-pk-chunking-extract-large-data-sets-salesforce

Migrate data from one organization to another: https://help.salesforce.com/s/articleView?id=000384648&type=1

If this information helps, please mark the answer as best. Thank you

All Answers

Arun Kumar 1141Arun Kumar 1141

Hi Gace,

 

If you try to use the normal REST API for individual record transfers when moving a lot of records from one Salesforce org to another, you can run into API restrictions and performance problems. The Salesforce Bulk API, which is made especially for handling massive amounts of data, is advised in these situations.

 

For more information, you refer to this Salesforce Documentation (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/api_asynch_introduction_bulk_api.htm)

 

If this helps, please mark it as the best answer

 

Thanks

Arun

GaceGace

Thank you, Arun! 

Can I use Bulk API in my apex code then?

SwethaSwetha (Salesforce Developers) 
HI Gace,
I see you also posted on https://salesforce.stackexchange.com/questions/405599/how-to-migrate-million-records-from-one-org-to-another and I've suggested trying PK Chunking to Extract Large Data Sets from Salesforce

Documentation: https://developer.salesforce.com/blogs/engineering/2015/03/use-pk-chunking-extract-large-data-sets-salesforce

Migrate data from one organization to another: https://help.salesforce.com/s/articleView?id=000384648&type=1

If this information helps, please mark the answer as best. Thank you
This was selected as the best answer
Arun Kumar 1141Arun Kumar 1141

HI Gace,

 

Yes, you can use Bulk API 2.0 using Apex and Flow.

 

You can refer to this blog for the approach -- Bulk Api 2.0 (https://newstechnologystuff.com/bulk-api-2-0-using-apex-and-flow/)

 

 

If this information helps, please mark the answer as best. Thank you