Hi Prismic team, we currently have a (mildly) awkward dual repo setup where one repo contains "site" content (products pages, about us, etc) and the other repo contains "content pages" content (blog, resources, etc).
This of course introduces complexity in our codebase and impacts maintainability so we're exploring the option of consolidating our repos into a single repo.
While war gaming how to achieve this, migrating existing documents via the migration API would copy the content of the documents over, but the documents reference media assets uploaded in the other repo. Is there a way to merge the media libraries of our two repos so that there will be no disruption in the content and that the prismic editor will still be able to select assets properly?
The Migration API will definitely help you out for the content, for the assets you can use the Asset API. The documentation for it is here if you want to check it out: Asset API Technical Reference - Documentation - Prismic. Alongside that, these example scripts can help you match the assets to the new repositories so it's easier to put the images back in the correct documents:
These resources are fantastic, along with the example about asset mapping to help link back assets from old -> new asset data.
Now a follow up question about merging repos. If some documents in repo 2 are referencing each other via content relationship, when we migrate these documents into repo 1, their references may break. How can we maintain that content relationships are mapped to their new document IDs that get created after they are saved into repo 1?
Regarding content relationships and migration, there's a section on this in the documentation here: Migrating to Prismic - Documentation - Prismic. It's absolutely possible to do that at the same time as you migrate the rest, and should prevent anything from breaking