Duplicate old store and create new store with existing products and collections

Hello,

We have two stores one is old store and second is new store.

We needed to duplicate the products and collections into the new store from old store.

For that we have export all products from old store and import all related products into new store.

Here the issue is it not update the collection on new store.

For that we have check that collection column not available on export products.

So, we have created one map script in liquid which can be helpful to associate the collection to their respective product with the reference of old store catalog.

Now the issue is while fetching the records from liquid it only bring 50 products of their specific collection.

So, how can we bring all the associated collection for all products and duplicate the store with their old store collection?