Hi!
I've been recently tinkering around with renaming/symlinking
repositories on Gerrit, so I thought my observations may help ;-)
On 14.09.2020 09:45, Antoine Musso wrote:
> Hello,
>
> I am looking at a process to be able to rename repositories in our
> Gerrit installation. Our environment is:
>
> * Gerrit 3.2.3
> * fully on NoteDB (by that I mean there is no more any MySQL database
> connection)
> * the secondary indices are backed up by Lucene.
> * we have multiple replicas
>
> Seems to me it might be as easy as:
>
> * stopping Gerrit
> * physically moving the git repository on disk to its new place
> * start Gerrit
> * remove the old project from all replicas
From my experience, that's the way to do it. I've done it in a similar
way with backwards compatibility, using symlinks - but I wouldn't
recommend it in the long run, there are problems with e.g. APIs not
working correctly
>
> My trouble comes to updating the secondary indices. I guess I can have
> the new project location indexed using:
>
> gerrit index changes-in-project <new project>
>
> But will it update the old entries to reflect the new project name?
That's all I do after a rename and after a short while e.g. all entries
on dashboard get updated project, they become searchable using new name.
>
> Is there a way to remove obsolete entries for the old project or does
> that require a full reindexing?
>
> I imagine that any URL referring to the old project ends up being
> broken, but a URL only having the change number will be fine.
>
> I would appreciate any pointer, resource, documentation, hint anyone
> might have.
>
BR,
Jakub
Best Regards,
Jakub