How to clear NoteDB

109 views
Skip to first unread message

Uwe Kindler

unread,
Sep 18, 2019, 2:46:25 AM9/18/19
to Repo and Gerrit Discussion
Hi,

how can I clear all NoteDB data if I want to start with a new clean code review server for a certain git repository? All review data is stored in the repository and whenever I do a new install of gerrit the indexing always pulls in all the old code review data from the repository. Because some of the code reviews are broken and cause a 500 server error (because branches are missing or because of other issues) I would like to get rid of all the NoteDB data in my repository to start with a clean Gerrit 3.0.2 install without any old code reviews.

Is there a tool, similar to the migration tool, to clear all review data from the repository or can I do that manually with some git commands?

Thank you,

Uwe

Gert van Dijk

unread,
Sep 18, 2019, 4:25:36 AM9/18/19
to Uwe Kindler, Repo and Gerrit Discussion
Have you considered just pushing the existing regular non-NoteDb branches/tags?

1. create the projects on the new server (untick the initial commit)
1. to the existing repositories clones locally (make sure they are up
to date), add the new server as remote (git remote add newserver ...)
1. push the regular branches & tags to the new server (e.g. git push
newserver refs/heads/*:refs/heads/*; git push newserver
refs/tags/*:refs/tags/*)

Alternatively, make a new fresh, regular clone (not mirror) from the
old server repositories and push them (with mirror) to the new server.

This will get rid of all 'meta' data and start from change 1 again on
the new server. Is that what you want?

HTH

David Ostrovsky

unread,
Sep 18, 2019, 4:42:40 AM9/18/19
to Repo and Gerrit Discussion

Am Mittwoch, 18. September 2019 08:46:25 UTC+2 schrieb Uwe Kindler:
Hi,

how can I clear all NoteDB data if I want to start with a new clean code review server for a certain git repository?

The remove-notedb-refs.sh that Ponch uploaded recently: [1] should
do exactly what you want.
 
All review data is stored in the repository and whenever I do a new install of gerrit the indexing always pulls in all the old code review data from the repository. Because some of the code reviews are broken and cause a 500 server error (because branches are missing or because of other issues) I would like to get rid of all the NoteDB data in my repository to start with a clean Gerrit 3.0.2 install without any old code reviews.

Well, you can't start with 3.0.2 without NoteDb. Release 2.16 is the
last release, where ReviewDb to NoteDb migration is supported: [2].


Uwe Kindler

unread,
Sep 18, 2019, 4:49:23 AM9/18/19
to Repo and Gerrit Discussion
Thank you for your help.

I'm not sure, I completely understand what you mean. We have a
repository that is on a server - lets say it is on S:\GIT\myrepository.
When we install Gerrit 3.0.2 it asks for the basePath. This is S:\GIT.
This is the basePath in gerrit.config. After the installation of gerrit,
we need to run the indexer via java -jar bin/gerrit.war reindex. If we
do this, then  gerrit will find all accounts, changes, groups and
projects of all projects in S:\GIT. It will also find all changes of
S:\GIT\myrepository. So there must be some Gerrit specific review data
stored in S:\GIT\myrepository.

I would like to clear all review data from S:\GIT\myrepository. That
means, if the indexer runs for the next time, it will not find any
Gerrit specific data in S:\GIT\myrepository but I would like to keep the
complete Git history of S:\GIT\myrepository. So I would like to strip
all review specific meta data from S:\GIT\myrepository so that it looks
like as if there had never been a code review for S:\GIT\myrepository.

Uwe



Uwe Kindler

unread,
Sep 18, 2019, 5:00:10 AM9/18/19
to Repo and Gerrit Discussion


On Wednesday, September 18, 2019 at 10:42:40 AM UTC+2, David Ostrovsky wrote:

Am Mittwoch, 18. September 2019 08:46:25 UTC+2 schrieb Uwe Kindler:
Hi,

how can I clear all NoteDB data if I want to start with a new clean code review server for a certain git repository?

The remove-notedb-refs.sh that Ponch uploaded recently: [1] should
do exactly what you want.

Ah, great. That looks like what I'm searching for. I will try this. Thank you very much.
 
 
All review data is stored in the repository and whenever I do a new install of gerrit the indexing always pulls in all the old code review data from the repository. Because some of the code reviews are broken and cause a 500 server error (because branches are missing or because of other issues) I would like to get rid of all the NoteDB data in my repository to start with a clean Gerrit 3.0.2 install without any old code reviews.

Well, you can't start with 3.0.2 without NoteDb. Release 2.16 is the
last release, where ReviewDb to NoteDb migration is supported: [2].



Yes, I know that I need NoteDb. I just would like to clear any review meta from a certain repository.

Reply all
Reply to author
Forward
0 new messages