At work we’ve been trying out Gerrit. It is awesome in many ways, and yet in others it is sorely lacking.
One of the more obvious problems is the lack of administration functionality. For example, there is no administration interface for deleting or renaming a project.
However, I needed to rename a project and here is how I did it.
WARNING: This was done against
schema_version 47. I make no promises
that it works for other versions.
This is a SQL script. Replace the words
OLD with your new and old
project names. Since I did it for multiple projects, I used Perl to
programmatically replace the values.
BEGIN; UPDATE account_project_watches SET project_name = 'NEW' WHERE project_name = 'OLD'; UPDATE projects SET name = 'NEW' WHERE name = 'OLD'; UPDATE ref_rights SET project_name = 'NEW' WHERE project_name = 'OLD'; UPDATE changes SET dest_project_name = 'NEW' WHERE dest_project_name = 'OLD'; COMMIT;
This is enough to hold me over until issue 560 is finished.
As of Gerrit 2.5.3, there is no longer a projects table nor a refrights table, so you just have to update the remaining two: accountproject_watches and changes. You’ll also want to rename the git repository on disk, of course. There is documentation on the process at http://ci.openstack.org/gerrit.html#renaming-a-project, though parts of it are specific to the openstack gerrit installation.