Hi,I am currently supporting 2.8.1 version and cannot upgrade.
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/d349ad6f-052b-48a0-b848-3b4f0c366820n%40googlegroups.com.
Hi,
I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/7dc9466d-0678-4223-a3a8-4ca43dae4a1cn%40googlegroups.com.
On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.
java -jar gerrit-war-2.9.5.war init --no-auto-start --batch -d /path/to/gerrit/site_dirjava -jar gerrit-war-2.11.12.war init --no-auto-start --batch -d /path/to/gerrit/site_dir
# build 2.16.war from the latest stable-2.16 commitjava -jar gerrit-war-2.16.war init --no-auto-start --no-reindex --batch --migrate-draft-to PRIVATE -d /path/to/gerrit/site_dir
java -jar gerrit-war-2.16.war migrate-to-note-db --reindex=false --threads 24 -d /path/to/gerrit/site_dir
# run 3.5 (our target version) init without reindex so that we can git gc/repack repos after all writes and before indexingjava -jar gerrit-war-3.5.war init --no-auto-start --reindex-threads=-1 -d /path/to/gerrit/site_dir
java -jar gerrit-war-3.5.war reindex --threads 60 -d /path/to/gerrit/site_dir
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAKSZd3TBjTEJ0AbmQYxb9wd20z-NP5PtX0_aYVyUvv0c4hdkTg%40mail.gmail.com.
On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].
Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.
10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/
You can do a minimal set of upgrades instead of doing every minor release. From 2.7, we needed 2.9, 2.11, 2.16, then the NoteDb migration on 2.16, then 3.5, then offline reindexing with 3.5. Starting with 2.8 you might be able to get directly to 2.11, but I'm not sure.We did these commands effectively:
java -jar gerrit-war-2.9.5.war init --no-auto-start --batch -d /path/to/gerrit/site_dirjava -jar gerrit-war-2.11.12.war init --no-auto-start --batch -d /path/to/gerrit/site_dir# build 2.16.war from the latest stable-2.16 commitjava -jar gerrit-war-2.16.war init --no-auto-start --no-reindex --batch --migrate-draft-to PRIVATE -d /path/to/gerrit/site_dirjava -jar gerrit-war-2.16.war migrate-to-note-db --reindex=false --threads 24 -d /path/to/gerrit/site_dir# run 3.5 (our target version) init without reindex so that we can git gc/repack repos after all writes and before indexingjava -jar gerrit-war-3.5.war init --no-auto-start --reindex-threads=-1 -d /path/to/gerrit/site_dirjava -jar gerrit-war-3.5.war reindex --threads 60 -d /path/to/gerrit/site_dirBe sure to add all your "normal" Gerrit java options, adjust the values above used for --threads to ones appropriate for your setup, and definitely TEST on a non-production environment first.Nasser
On Thursday 1 February 2024 at 11:02:55 UTC+5:30 Nasser Grainawi wrote:On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].did not quite understand but just did Reply to All and then hit the ... to expand it and started to write in between. I hope this is right else please instruct.Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.I had already tried this and also posted errors in past where I was getting stuck but did not find solutions so had to abort.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/Thanks for sharing your experience on it. I assume that below init command on existing site_dir will be OK to do and does not need empty site_dir etc. I mean its going to update under site_dir but will not touch site_dir/repo. Also I have only one instance / env of gerrit so need advise how to clone it to my laptop. can I copy the structure below without repositories folder to debian vm on laptop and export import mysql to laptop vm ? you can see repositories is huge so copying it from data center server to laptop will be difficult.
[jioapp@NVMBD01VSR634 data]$ ls -l gerrit
total 232
drwxrwxr-x 2 gerrit2 gerrit2 4096 Nov 2 21:48 bin
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 25 17:23 cache
drwxrwxr-x 2 gerrit2 gerrit2 4096 Mar 17 2016 data
drwxrwxr-x 3 gerrit2 gerrit2 4096 Jun 7 2023 etc
drwxr-xr-x 2 gerrit2 gerrit2 4096 Mar 17 2016 lib
drwxrwxr-x 2 gerrit2 gerrit2 176128 Feb 1 10:42 logs
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jun 9 2017 plugins
drwxrwxr-x 244 gerrit2 gerrit2 16384 May 26 2023 repositories
drwxrwxr-x 2 gerrit2 gerrit2 4096 Mar 17 2016 static
drwx------ 10 gerrit2 gerrit2 12288 Jan 25 17:23 tmp
[jioapp@NVMBD01VSR634 data]$ du -sm gerrit/repositories/
63077 gerrit/repositories/
[jioapp@NVMBD01VSR634 data]$ pwd
/data[gerrit2@NVMBD01VSR634 data]$ du -sm gerrit
63785 gerritonce I copy to all this and have running setup on laptop I can try below commands you shared downloading the war files from download folders (https://gerrit-releases.storage.googleapis.com/index.html). Also note on idc server we have to go via proxy (no direct internet) so please advise what exact site I need to whitelist just in case we get to use it. I assume /data/gerrit <=> /path/to/gerrit/site_dir.
You can do a minimal set of upgrades instead of doing every minor release. From 2.7, we needed 2.9, 2.11, 2.16, then the NoteDb migration on 2.16, then 3.5, then offline reindexing with 3.5. Starting with 2.8 you might be able to get directly to 2.11, but I'm not sure.We did these commands effectively:
java -jar gerrit-war-2.9.5.war init --no-auto-start --batch -d /path/to/gerrit/site_dirjava -jar gerrit-war-2.11.12.war init --no-auto-start --batch -d /path/to/gerrit/site_dir# build 2.16.war from the latest stable-2.16 commitjava -jar gerrit-war-2.16.war init --no-auto-start --no-reindex --batch --migrate-draft-to PRIVATE -d /path/to/gerrit/site_dirjava -jar gerrit-war-2.16.war migrate-to-note-db --reindex=false --threads 24 -d /path/to/gerrit/site_dir# run 3.5 (our target version) init without reindex so that we can git gc/repack repos after all writes and before indexingjava -jar gerrit-war-3.5.war init --no-auto-start --reindex-threads=-1 -d /path/to/gerrit/site_dirjava -jar gerrit-war-3.5.war reindex --threads 60 -d /path/to/gerrit/site_dirBe sure to add all your "normal" Gerrit java options, adjust the values above used for --threads to ones appropriate for your setup, and definitely TEST on a non-production environment first.NasserI do not know what java options might have been used as I inherited this setup and am just supporting. may be you can guide on what value of threads I need to use based on lscpu:
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/1e5bc652-715b-40ca-8fc6-ab79f2c73251n%40googlegroups.com.
On Thu, Feb 1, 2024 at 5:07 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 11:02:55 UTC+5:30 Nasser Grainawi wrote:On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].did not quite understand but just did Reply to All and then hit the ... to expand it and started to write in between. I hope this is right else please instruct.Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.I had already tried this and also posted errors in past where I was getting stuck but did not find solutions so had to abort.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/Thanks for sharing your experience on it. I assume that below init command on existing site_dir will be OK to do and does not need empty site_dir etc. I mean its going to update under site_dir but will not touch site_dir/repo. Also I have only one instance / env of gerrit so need advise how to clone it to my laptop. can I copy the structure below without repositories folder to debian vm on laptop and export import mysql to laptop vm ? you can see repositories is huge so copying it from data center server to laptop will be difficult.There's some good information on how to make backups in https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.1/backup.html (and that still includes information on how to do backups with 2.x versions).
On Thursday 1 February 2024 at 20:49:33 UTC+5:30 Nasser Grainawi wrote:On Thu, Feb 1, 2024 at 5:07 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 11:02:55 UTC+5:30 Nasser Grainawi wrote:On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].did not quite understand but just did Reply to All and then hit the ... to expand it and started to write in between. I hope this is right else please instruct.Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.I had already tried this and also posted errors in past where I was getting stuck but did not find solutions so had to abort.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/Thanks for sharing your experience on it. I assume that below init command on existing site_dir will be OK to do and does not need empty site_dir etc. I mean its going to update under site_dir but will not touch site_dir/repo. Also I have only one instance / env of gerrit so need advise how to clone it to my laptop. can I copy the structure below without repositories folder to debian vm on laptop and export import mysql to laptop vm ? you can see repositories is huge so copying it from data center server to laptop will be difficult.There's some good information on how to make backups in https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.1/backup.html (and that still includes information on how to do backups with 2.x versions).I am doing full backup of /data/gerrit (tar) and mysql db dump. My query was if I copy /data/gerrit without repositories folder will the upgrade steps you mentioned be fine to do. Due to size issue and access issue I suggested to experiment with setup on my laptop. Its java and debian instead of redhat (in data center). Once I apply all upgrade then I can just copy it back on /data/gerrit in data center. does it sound OK ?
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/bb75c308-7f05-41a5-88f7-743a34067a92n%40googlegroups.com.
On Fri, Feb 2, 2024 at 1:41 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 20:49:33 UTC+5:30 Nasser Grainawi wrote:On Thu, Feb 1, 2024 at 5:07 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 11:02:55 UTC+5:30 Nasser Grainawi wrote:On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].did not quite understand but just did Reply to All and then hit the ... to expand it and started to write in between. I hope this is right else please instruct.Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.I had already tried this and also posted errors in past where I was getting stuck but did not find solutions so had to abort.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/Thanks for sharing your experience on it. I assume that below init command on existing site_dir will be OK to do and does not need empty site_dir etc. I mean its going to update under site_dir but will not touch site_dir/repo. Also I have only one instance / env of gerrit so need advise how to clone it to my laptop. can I copy the structure below without repositories folder to debian vm on laptop and export import mysql to laptop vm ? you can see repositories is huge so copying it from data center server to laptop will be difficult.There's some good information on how to make backups in https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.1/backup.html (and that still includes information on how to do backups with 2.x versions).I am doing full backup of /data/gerrit (tar) and mysql db dump. My query was if I copy /data/gerrit without repositories folder will the upgrade steps you mentioned be fine to do. Due to size issue and access issue I suggested to experiment with setup on my laptop. Its java and debian instead of redhat (in data center). Once I apply all upgrade then I can just copy it back on /data/gerrit in data center. does it sound OK ?No. You must have a copy of the repositories when you run the upgrade commands.
On Friday 2 February 2024 at 21:59:02 UTC+5:30 Nasser Grainawi wrote:On Fri, Feb 2, 2024 at 1:41 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 20:49:33 UTC+5:30 Nasser Grainawi wrote:On Thu, Feb 1, 2024 at 5:07 AM Miten Mehta <india...@gmail.com> wrote:On Thursday 1 February 2024 at 11:02:55 UTC+5:30 Nasser Grainawi wrote:On Mon, Jan 29, 2024 at 11:53 PM Matthias Sohn <matthi...@gmail.com> wrote:On Tue, Jan 30, 2024 at 8:17 AM Miten Mehta <india...@gmail.com> wrote:Hi,I had tried upgrading but it did was not simple as replacing the war and may be running sql scripts. I would expect that install dir repo area should get picked up without any issues with new upgrade and also database changes should not cause any issues for user access/projects list etc. but it was not so. if you have some dedicated spoc for it then I can retry.Please avoid top posting on this list, we prefer interleaved style [1].did not quite understand but just did Reply to All and then hit the ... to expand it and started to write in between. I hope this is right else please instruct.Follow the release notes [2] for upgrades, go minor release by minor release (e.g. from 2.8.1 to 2.9.5).Always use the latest service release per minor release (e.g. 2.9.5 for 2.9.x).First read the "Important notes" for each version bump to get an overview what needs to be done.I had already tried this and also posted errors in past where I was getting stuck but did not find solutions so had to abort.10 years after the fact it might be tricky to find all prerequisites, e.g. old Java and database versions.Yes, there's some challenges there. We successfully upgraded from 2.7 (a forked version) to 3.5 a little over 5 months ago. I'm overdue on a write up concluding the journey, but you can read some of the earlier progress we made here: https://groups.google.com/g/repo-discuss/c/WVwvngCkRMs/Thanks for sharing your experience on it. I assume that below init command on existing site_dir will be OK to do and does not need empty site_dir etc. I mean its going to update under site_dir but will not touch site_dir/repo. Also I have only one instance / env of gerrit so need advise how to clone it to my laptop. can I copy the structure below without repositories folder to debian vm on laptop and export import mysql to laptop vm ? you can see repositories is huge so copying it from data center server to laptop will be difficult.There's some good information on how to make backups in https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.1/backup.html (and that still includes information on how to do backups with 2.x versions).I am doing full backup of /data/gerrit (tar) and mysql db dump. My query was if I copy /data/gerrit without repositories folder will the upgrade steps you mentioned be fine to do. Due to size issue and access issue I suggested to experiment with setup on my laptop. Its java and debian instead of redhat (in data center). Once I apply all upgrade then I can just copy it back on /data/gerrit in data center. does it sound OK ?No. You must have a copy of the repositories when you run the upgrade commands.I will use unix split and cat command to get the huge 66GB gerrit dir tar to my laptop. now do I need to have gerrit process running to do the upgrade (meaning as I do your git init and other commands you provided and any other) ? If I have to run it then I will also need to get db setup on local (export/import mysql) and then can I just change the db section details in gerrit config like ip ? Also I have ldap authentication against corporate directory so can I turn that off instead and do some harcoded credentials to get it running just for upgrade on local ? how ?
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/909c4495-cdf3-4ec0-9cc3-9888b6625059n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/b9dae503-25ed-4109-83cd-2d112e5e1175n%40googlegroups.com.
Hi,I am using mysql 5.1.73. I have upgraded gerrit war from 2.8.1 to 3.9.2 on laptop.now reviewdb is only database i need to export and import into datacenter mysql db ?mysqldump -u root -p "reviewdb" > dump.sql
do I need to login to datacenter mysql db and drop reviewdb first before importing it? my dba uses some mysqlbkp user to take backups can he use same instead of root in below command? I guess he only will be doing it and might know what to do but in general is below command correct ?
mysql -u root -p reviewdb < dump.sql
Now also copy laptop gerrit dir to datacenter.
currently dataceneter gerrit is in use. It might have got more commits.
1. To upgrade datacenter gerrit with my laptop gerrit I am thinking to block writes to datacenter gerrit for few hours.
how do I prevent writes to gerrit in datacenter but users can read and clone fine?take copy of gerrit site dir in datacenter to my laptop and db dump also and repeat upgrade steps on my laptop and then update datacenter gerrit as above to copy db and gerrit site.
Hi,
I am using mysql 5.1.73. I have upgraded gerrit war from 2.8.1 to 3.9.2 on laptop.now reviewdb is only database i need to export and import into datacenter mysql db ?mysqldump -u root -p "reviewdb" > dump.sql
do I need to login to datacenter mysql db and drop reviewdb first before importing it? my dba uses some mysqlbkp user to take backups can he use same instead of root in below command? I guess he only will be doing it and might know what to do but in general is below command correct ?
mysql -u root -p reviewdb < dump.sql
Now also copy laptop gerrit dir to datacenter.
currently dataceneter gerrit is in use. It might have got more commits.
1. To upgrade datacenter gerrit with my laptop gerrit I am thinking to block writes to datacenter gerrit for few hours.
how do I prevent writes to gerrit in datacenter but users can read and clone fine?
take copy of gerrit site dir in datacenter to my laptop and db dump also and repeat upgrade steps on my laptop and then update datacenter gerrit as above to copy db and gerrit site.
2. or if users try to push with more commits to upgraded gerrit that I have on laptop which I will copy to datacenter will it be fine ?
I have done below commands based on what was shared to me in this group:
GHOME is /data/gerrit
and where we see --add-opens I used jdk17. basically I started with jdk17 but then 2.9.5 to 2.16.28 I used jdk8 as soon as I encountered errors doing first reindex on 2.9.5. Then 3.5.6 I had to switch back to jdk17 as jdk8 is not supported.
java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-2.9.5.war init --no-auto-start --batch -d $GHOME
java -jar gerrit-2.9.5.war reindex -d $GHOME
java -jar gerrit-2.11.12.war init --no-auto-start --batch -d $GHOME
java -jar gerrit-2.11.12.war reindex -d $GHOME
java -jar gerrit-2.11.12.war reindex -d $GHOME
java -jar gerrit-2.16.28.war init --no-auto-start --no-reindex --batch -d $GHOME
java -jar gerrit-2.16.28.war reindex --index changes -d $GHOME #then repeated for index groups, accounts, projectsjava -jar ./gerrit-2.16.28.war migrate-to-note-db --reindex=false --threads 24 -d /data/gerrit/
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.5.6.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java -jar ./gerrit-3.5.6.war reindex -d /data/gerrit/
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.6.8.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.6.8.war reindex --index changes -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.7.8.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.7.8.war reindex --index changes -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.8.4.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.9.2.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOMEis there a way to do init and reindex both in one command as it seems whenever there are any db schema changes reindex was needed. I guess if I leave out --reindex-threads option it will by default do reindex or if I use postive value of it then I might not need to reindex after init.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/d9c392d5-04cd-4d43-9570-53b66ac69d42n%40googlegroups.com.
On Wed, Mar 6, 2024 at 12:22 PM Miten Mehta <india...@gmail.com> wrote:Hi,I am using mysql 5.1.73. I have upgraded gerrit war from 2.8.1 to 3.9.2 on laptop.now reviewdb is only database i need to export and import into datacenter mysql db ?mysqldump -u root -p "reviewdb" > dump.sqlAfter the migration to notedb on 2.16.28 the reviewdb is not used anymore andall primary data is stored in the git repositories. Only file reviewed flags are storedin a relational database after the migration, see
do I need to login to datacenter mysql db and drop reviewdb first before importing it? my dba uses some mysqlbkp user to take backups can he use same instead of root in below command? I guess he only will be doing it and might know what to do but in general is below command correct ?
mysql -u root -p reviewdb < dump.sql
Now also copy laptop gerrit dir to datacenter.
currently dataceneter gerrit is in use. It might have got more commits.If you do the upgrade on a copy of the production system you need to ensurethe production system is not modified until it was replaced by the upgraded copy.The simplest way to achieve that is to shutdown the production system during the upgrade.
1. To upgrade datacenter gerrit with my laptop gerrit I am thinking to block writes to datacenter gerrit for few hours.
how do I prevent writes to gerrit in datacenter but users can read and clone fine?The readonly plugin might be a solution, but not on 2.8.1, it's only available starting from 2.14.I don't have experience using it on these old versions.
take copy of gerrit site dir in datacenter to my laptop and db dump also and repeat upgrade steps on my laptop and then update datacenter gerrit as above to copy db and gerrit site.I wouldn't upgrade a production system on my laptop but only on some controlled staging serveror directly on the production server. Don't forget to take a full backup before upgrading.And test restoring the system from a backup before you start the upgrade.
2. or if users try to push with more commits to upgraded gerrit that I have on laptop which I will copy to datacenter will it be fine ?
I have done below commands based on what was shared to me in this group:
GHOME is /data/gerrit
and where we see --add-opens I used jdk17. basically I started with jdk17 but then 2.9.5 to 2.16.28 I used jdk8 as soon as I encountered errors doing first reindex on 2.9.5. Then 3.5.6 I had to switch back to jdk17 as jdk8 is not supported.
java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-2.9.5.war init --no-auto-start --batch -d $GHOME
java -jar gerrit-2.9.5.war reindex -d $GHOME
java -jar gerrit-2.11.12.war init --no-auto-start --batch -d $GHOME
java -jar gerrit-2.11.12.war reindex -d $GHOME
java -jar gerrit-2.11.12.war reindex -d $GHOME
java -jar gerrit-2.16.28.war init --no-auto-start --no-reindex --batch -d $GHOME
java -jar gerrit-2.16.28.war reindex --index changes -d $GHOME #then repeated for index groups, accounts, projectsjava -jar ./gerrit-2.16.28.war migrate-to-note-db --reindex=false --threads 24 -d /data/gerrit/
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.5.6.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java -jar ./gerrit-3.5.6.war reindex -d /data/gerrit/
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.6.8.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.6.8.war reindex --index changes -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.7.8.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.7.8.war reindex --index changes -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.8.4.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOME
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED -jar gerrit-3.9.2.war init --no-auto-start --reindex-threads=-1 --batch -d $GHOMEis there a way to do init and reindex both in one command as it seems whenever there are any db schema changes reindex was needed. I guess if I leave out --reindex-threads option it will by default do reindex or if I use postive value of it then I might not need to reindex after init.I think it's not necessary to reindex after each intermediate upgrade.It should be sufficient to do a full reindex after the last upgrade to 3.9.2.
In few steps I guess reindex ones I saw some exception/errors like missing commit and projects like below. I hope they are ignorable.com.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: Cannot open repository jionetmcom.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 7ff2fc9b614e1faaf712256bb8aa978d547639c1
On Thursday 7 March 2024 at 04:31:19 UTC+5:30 Matthias Sohn wrote:On Wed, Mar 6, 2024 at 12:22 PM Miten Mehta <india...@gmail.com> wrote:Hi,I am using mysql 5.1.73. I have upgraded gerrit war from 2.8.1 to 3.9.2 on laptop.now reviewdb is only database i need to export and import into datacenter mysql db ?mysqldump -u root -p "reviewdb" > dump.sqlAfter the migration to notedb on 2.16.28 the reviewdb is not used anymore andall primary data is stored in the git repositories. Only file reviewed flags are storedin a relational database after the migration, seeBut I still need to copy db dump from laptop to datacenter mysql right ? what I understand is minimal but cannot ignore that data and still need to be in place. I did not see any notedb database in mysql when I did show databases. It still shows reviewdb only.
do I need to login to datacenter mysql db and drop reviewdb first before importing it? my dba uses some mysqlbkp user to take backups can he use same instead of root in below command? I guess he only will be doing it and might know what to do but in general is below command correct ?
mysql -u root -p reviewdb < dump.sql
Now also copy laptop gerrit dir to datacenter.
currently dataceneter gerrit is in use. It might have got more commits.If you do the upgrade on a copy of the production system you need to ensurethe production system is not modified until it was replaced by the upgraded copy.The simplest way to achieve that is to shutdown the production system during the upgrade.ok best is to take datacenter gerrit down and then copy site folder and db. bring up datacenter gerrit and most probably it should work. you meant that while file copy and db dump import is happening there should be no modifications to both which if system is not down could happen.
1. To upgrade datacenter gerrit with my laptop gerrit I am thinking to block writes to datacenter gerrit for few hours.
how do I prevent writes to gerrit in datacenter but users can read and clone fine?The readonly plugin might be a solution, but not on 2.8.1, it's only available starting from 2.14.I don't have experience using it on these old versions.I will better bring datacenter gerrit down. Also for earlier deleteproject plugin I was unable to make it work so when I upgrading and reached a release for which there was compatiable deleteproject plugin jar avaiable I started to use it fine.
In few steps I guess reindex ones I saw some exception/errors like missing commit and projects like below. I hope they are ignorable.com.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: Cannot open repository jionetmcom.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 7ff2fc9b614e1faaf712256bb8aa978d547639c1will above be any issue ? I assume the misisng repo might be like I must have deleted it from file system as way to do deleteproject since that plugin was not doing it works for me in 2.8.1. Also any missing commits would be issue ?
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/80962a36-acf3-4bb0-b3dc-45a361af6960n%40googlegroups.com.
com.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: Cannot open repository jionetmcom.google.gwtorm.server.OrmException: org.eclipse.jgit.errors.MissingObjectException: Missing unknown 7ff2fc9b614e1faaf712256bb8aa978d547639c1will above be any issue ? I assume the misisng repo might be like I must have deleted it from file system as way to do deleteproject since that plugin was not doing it works for me in 2.8.1. Also any missing commits would be issue ?