Increment ci_pipelines_id_seq

Hello. We’re currently migrating projects from one gitlab instance to another, due to management/corporate shenanigans. The old gitlab instance will be abandoned. We have many artifacts building in CI that use the CI_PIPELINE_ID variable in their versioning scheme, and when their CIs run in the new instance, they end up with smaller pipeline ID numbers due to the new instance being recently created. This puts us in the position where newer artifacts have “older” versions, and eventually versions will collide. We have around 6000 projects and there’s a lot of politics involved, so asking for version scheme changes is out of the question.

What we want to do is increment the CI_PIPELINE_ID in the new instance so that it’s larger than the ones we had in the previous instance.

I explored a bit where this variable is defined, I came across the merge request that introduced this variable: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4826. It seems to me that the CI_PIPELINE_ID is simply the primary key of the Pipeline object, which is represented in the DB in the ci_pipelines table. The sequence that manages this key is ci_pipelines_id_seq.

Would running an ALTER SEQUENCE on ci_pipelines_id_seq be enough to bump all pipeline IDs, or are there any other sequences I should take into account? Or is this totally unfeasible?

Thanks!