maven私库nexus2.3.0-04迁移升级到nexus-3.16.1-02(异机迁移备份)

 环境信息:

nexus2.3.0-04安装在32位Windows server 2003系统上

安装位置信息如下:

仓库迁移

Nexus的构件仓库都保存在sonatype-work目录中,nexus2.x该目录的位置由conf/nexus.vmoptions,nexus3.x该目录的位置由bin/nexus.vmoptions配置文件指定(Dkaraf.data)。

仓库迁移需要两个过程:备份和还原

备份仓库

将sonatype-work文件夹整体备份即可,也可以选择只备份最重要的两个文件夹索引(indexer)和仓库(storage)

另一台服务器配置信息如下:

首先给系统配置jdk1.8以上版本(不配置也可以,nexus本身附带),然后配置maven,这里选择maven-3.6.0版本,配置过程省略

要把nexus从2版本升级到3版本,需要先把nexus升级到2版本的最高版本,然后在升级到3版本

nexus最新版本下载地址:

https://help.sonatype.com/repomanager3/download

nexus2.x版本下载地址:

https://www.sonatype.com/download-oss-sonatype?hsCtaTracking=920dd7b5-7ef3-47fe-9600-10fecad8aa32%7Cf59d5f10-099f-4c66-a622-0254373f4a92

https://help.sonatype.com/repomanager2/download

下载文件如下:

上传到Windows server 2008 R2服务器上,并安装nexus2.x和nexus3.x

解压:

nexus2.x

解压nexus3.x

更改nexus2.x的默认端口号,已免同时安装两个nexus发生端口冲突

打开此文件,修改端口为8082

安装nexus2.x

执行脚本一键安装

官网参考手册:

https://help.sonatype.com/repomanager2/installing-and-running

安装nexus3.x

官网参考手册:

https://help.sonatype.com/repomanager3/installation

启动:

J:\nexus3\nexus-3.16.1-02\bin>nexus.exe /start nexus3

停止:

J:\nexus3\nexus-3.16.1-02\bin>nexus.exe /stop nexus3

卸载:

J:\nexus3\nexus-3.16.1-02\bin>nexus.exe /uninstall nexus3

查看安装的服务

关闭防火墙访问页面确认服务是否启动成功

默认管理员账号密码是admin/admin123

nexus2.x页面

nexus3.x页面

关闭nexus2.x服务进行仓库迁移,拷贝备份最重要的两个文件夹索引(indexer)和仓库(storage)到Windows server2008 R2 中

重启服务,即升级迁移到2.x最新版本成功

nexus2.x最新版本迁移升级到nexus-3.x

配置 Upgrade:Agent

Nexus2.14.12要进行仓库迁移的话,需要我们配置Upgrade:Agent,Upgrade:Agent的配置比较简单,如下:

 add添加成功

要把nexus2.14.12迁移到nexus3.16.1的话,在nexus3.16.1上也需要开启upgrade,并且迁移操作在nexus3.16.1的web端,下面在nexus3上开启upgrade:

 创建upgrade

 create

 create successful

 next

 agent connection setting

 connect successful

接下来按步骤提示操作,

同步迁移成功后,修改maven配置文件

conf文件夹下setting

 如下:

<mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.1.108:8081/repository/maven-public/</url>
    </mirror>
  </mirrors>

 

参考博客:

maven私库nexus2.11.4迁移升级到nexus3.12.0

http://www.cnblogs.com/liangyou666/p/9439755.html

Nexus 3.X(Maven仓库私服)仓库迁移与备份

https://www.cnblogs.com/nethrd/p/9554163.html

linux7下nenux3.14的maven私服搭建和配置使用

https://www.cnblogs.com/xiaoyao-001/p/9859979.html

nexus 2.X版本升级 3.X版本

http://www.mamicode.com/info-detail-2323203.html

Nexus私服库快速导入jar包

https://blog.csdn.net/liulihui1988/article/details/80422151

posted on 2019-04-22 10:14  阿小杜  阅读(1236)  评论(0编辑  收藏  举报