Hi, friend.
Depending on the number of lines, it will be a slow process. I don't think that's a way to do that automatically, so you have to fecth and create data through loops.
Be aware to handling errors and how you'll or not roll back the data.
Do that inside a timer to run assynchoronously.
Kind regards