
升级流程

因为orient数据库已经不继续维护所以我们升级到3.7x需要先将数据库转换成H2或者PG才能支持后续的升级
升级到 3.7.0
备份数据
1
| rsync -avzPogp --delete /home/make/nexus/sonatype-work /mnt/data/
|
下载文件
1 2 3
| cd nexus wget https://download.sonatype.com/nexus/3/nexus-3.70.4-02-java8-unix.tar.gz wget https://download.sonatype.com/nexus/nxrm3-migrator/nexus-db-migrator-3.70.4-02.jar
|
解压文件
1 2
| cd nexus tar zxvf nexus-3.70.4-02-java8-unix.tar.gz
|
启动服务
1
| ./nexus-3.70.4-02/bin/nexus run
|
转换数据库
- 到nexus页面上导出数据库


- 执行导出任务(应该很快刷新一下界面就好了)

- 关闭nexus服务
这一步非常重要,不要在服务运行时操作,一定要确保服务关闭了
- 转换数据库文件
1 2
| cd /home/make/nexus/sonatype-work/nexus3/exportdb-files java -Xmx16G -Xms16G -XX:+UseG1GC -XX:MaxDirectMemorySize=28672M -jar ../../../nexus-db-migrator-3.70.4-02.jar --migration_type=h2
|
- 会生成一个文件 nexus.mv.db

升级到 3.7.11
下载文件
1 2
| wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz wget https://download.sonatype.com/nexus/3/nexus-3.77.1-01-unix.tar.gz
|
升级JDK到17
1
| sudo apt-get install openjdk-17-jdk openjdk-17-jre
|
清空db文件夹
1 2
| cd /home/make/nexus/sonatype-work/nexus3/ rm -rf db/*
|
将转存的db文件放到db文件夹下
1
| mv ../nexus3/export-file/nexus.mv.db db/
|
修改配置
1 2 3
| vim sonatype-work\nexus3\etc\nexus.properties # 添加以下行 nexus.datastore.enabled=true
|
启动服务
注意:一定要等nexus将索引构建完成再做其他操作(如重启等)否则会导致数据丢失。
1
| systemctl daemon-reload && systemctl restart nexus.service && systemctl status nexus.service
|
相关问题
- 如果出现数据损坏或者在升级过程中有人发布了包可以去重新跑一下任务。

关闭提示
新版本只是弹个提示,如果需要查看是哪些包需要购买nexus的防火墙产品。

home/make/nexus/sonatype-work/nexus3/etc/nexus.properties
1 2
| nexus.malware.risk.enabled=false nexus.malware.risk.on.disk.enabled=false
|
重启服务即可
相关文档
- https://help.sonatype.com/en/orient-pre-3-70-java-8-or-11.html