Get all old UIDs associated with a given document

We recently had an issue with this.

We decided to create a new document type and manually migrate from the old to the new.

We were unaware that one document had an "old" UID, since this was not discoverable anywhere within Prismic. When we migrated, we made sure all documents were migrated by looking at the documents in Prismic, but because the old UID was not discoverable anywhere, this was missed. Traffic hit the old UID resulting in 404 errors and it took us some time to get to the bottom of the issue.

It should be possible to find alternate UIDs for a document because as-it-stands, they're effectively "secret" unless you already know they exist.

Thanks :slight_smile:

Hi Eilidh,

I know how this can be time-consuming as a process and hopefully, the team will be able to look into this issue soon.

I know this is on their radar but it's not currently being worked on. If/when this changes the team will update everyone here.

Thanks.

Our project has a big redirect list. Sometimes the site goes down due to "redirects storm". This could be because of redirect loops! The redirection from old document UIDs to current is enabled. This creates unknown redirection chains.
So it's critically important for us to have all the UIDs of all the documents to solve the issue.
Do you have some beta API to retrieve all previous UIDs of documents now?!

Hi Sergey,

Welcome to the community :slight_smile:

Unfortunately, we don't have any beta projects or anything in the works for this right now.

I understand your frustration and agree that this would make redirect management much easier.

When the team has any updates about this we'll let you know here.

Thanks.

Do the old UIDs transfer to a cloned repository?

The UIDs history is wiped out if one creates a clone of a document, deletes the original, and then replaces it with the clone. But what about cloning a whole repository?

There's currently no option to 'clone' as a repository, but there is the migration API. In the migration API, if you upload a document to a new repository, the UID history will not be maintained.