Moving NoteDB data from old server to a new Gerrit instance

128 views
Skip to first unread message

Szymon Datko

unread,
Jan 23, 2020, 12:45:28 PM1/23/20
to Repo and Gerrit Discussion
Hello, 

I have a working Gerrit instance which I must drop and move to a new installation. Though, I would like to transfer all data (history of changes, comments, votes) to this new server. The old Gerrit server is version 2.16 with NoteDB, the target server will be Gerrit 3.1. I found old notes/posts about moving data with old SQL database, stating it is possible. Now everything is in git and here starts my problem. 

In testing repository I attempted to fetch and push regular branches, as well as some refs/changes/XX/XXXX/X, refs/changes/XX/XXXX/meta and refs/notes/review thing. The data were accepted by new Gerrit server after passing `-o notedb=allow` to git push command, the project is there in new Gerrit with all git tree present, however it is impossible to find history of changes in Gerrit interface. It is not present on list of merged changes, and when I am opening an URL in web browser where the change should be (guessing the address), instead of Not Found, I get the message "An error occurred \n Error 500: Server Error \n Endpoint: /changes/*~*/robotcomments". This last refspec /robotcomments I cannot find on my old Gerrit server. The changes IDs I tried to copy so far are higher than any present in new Gerrit instance, so no duplication yet. (The problem of reindexing the changes I planned to tackle later – is it doable, by the way?) 

Did I miss something in the process or what I am attempting is currently impossible? 

Thanks a lot for any suggestions! 

Yours, Szymon Datko 

Matthias Sohn

unread,
Jan 23, 2020, 5:04:58 PM1/23/20
to Szymon Datko, Repo and Gerrit Discussion
I think moving data between 2.16 and 3.1 without migrating it to the changed schema is impossible. 
Both upgrades from 2.16 to 3.0 and from 3.0 to 3.1 involve schema changes which require migration of existing data:
You should be able to copy the data to another server having the same version as your old server and
then upgrade the new server to 3.1.

Always read the release notes of all releases between your old release up to the release you are upgrading to
before you do the actual upgrade. Especially read the "Important Notes" section carefully.
And always create a full backup before upgrading a productive server and fire drill restoring backups.

-Matthias
Reply all
Reply to author
Forward
0 new messages