#community-help

Duplicating a Collection and Creating an Alias

TLDR Gabe wanted to duplicate a collection and create an alias. Jason suggested exporting old documents and importing them into a new collection.

Powered by Struct AI

1

7
31mo
Solved
Join the chat
Jun 24, 2021 (31 months ago)
Gabe
Photo of md5-7aff1bf99393eb318e36513504a16e85
Gabe
06:32 PM
is there any way to duplicate a collection, so I can create an alias.
• I have one collection called lists
• I'd like to duplicate this to lists-<TIME>
• drop the original lists
• then alias lists=>lists-<TIME>
Jason maybe y'all have some way to easily achieve this on the backend?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:10 PM
One way to do this would be to use the documents/export endpoint on the old collection and then send the output to the documents/import endpoint of the new collection
Jun 25, 2021 (31 months ago)
Gabe
Photo of md5-7aff1bf99393eb318e36513504a16e85
Gabe
07:56 PM
gotcha, so I need to use the same schema to create a new collection, then export from old & import to new?

Can't wait till y'all enable updating schemas on the fly 😅
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:49 PM
That’s correct.

Yup schema update is high in priority list!
Gabe
Photo of md5-7aff1bf99393eb318e36513504a16e85
Gabe
08:52 PM
oo just realized I can at least create the new collection via the console...sweet!

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:54 PM
And you can copy paste the old schema from the “Schema” section and edit as needed!
Gabe
Photo of md5-7aff1bf99393eb318e36513504a16e85
Gabe
08:54 PM
yup yup!