1

I have roughly 10 million records in a big object and now I need to move the data/clone the records in another big object.

The reason why I am doing this is that I need to modify/add more fields to the unique key in the big object. So, I have created a new big object with a new unique key and now need to migrate the data into a new big object.

I have tried with the data loader Bulk API checkbox, but I get an error after some time:

Failed to write query result- Internal Server Error

What would be the best way to do that?

2
  • forceamp.com
    – gNerb
    Jan 28, 2020 at 14:35
  • Did you find the solution? I also need to transfer records from big object to big object and i have 10M records. Please help. Oct 18, 2022 at 8:26

1 Answer 1

0

If Data loader is not working, you must use a batch class, it should still be relatively simple.

You'd start by querying every single field from the object you want to transfer in the .start() function. Then in execute(), you'd create a new record for each original record in your scope, copy all the values, and at the end of the loop insert them.

Keep the batch size as per you need, default is 200 records.

3
  • deleteImmediate() doesn't work on more than 1 record at a time, If I run a batch on 1 million records with batch size 1 would be a never-ending process. Jan 29, 2020 at 6:45
  • but why do you want to use deleteImmediate() method, we need to just migrate the data from one big object to other. Also, why to keep batch size as 1, are you running some major functionality on insert of data in that object?
    – ShrutiG
    Jan 29, 2020 at 8:41
  • Database.querylocator doesn't support big objects. Because count() is not available. I need to run multiple batches. And also need to delete data from older object Jan 30, 2020 at 7:21

You must log in to answer this question.

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