1Panel V1 服务迁移至 V2

一、正常升级未出现报错

迁移期间将停止当前 V1 服务,请确认风险后再继续操作。
是否确认将 V1 迁移至 V2 主节点? (y/n): y
2025/07/10 17:56:29 即将开始自动下载 V2 安装包,请耐心等待,勿关闭终端。
2025/07/10 17:56:32 下载安装文件成功!
2025/07/10 17:56:33 初始化 core.db 完成
2025/07/10 17:56:33 [xpack] 初始化 core.db 完成
2025/07/10 17:56:34 初始化 agent.db 完成
2025/07/10 17:56:34 [xpack] 初始化 agent.db 完成
2025/07/10 17:56:34 基础数据初始化成功!
2025/07/10 17:56:34 即将自动迁移并备份 V1 相关数据,请耐心等待,勿关闭终端。
2025/07/10 17:56:38 数据迁移成功!
2025/07/10 17:56:38 备份 V1 相关数据成功!
迁移成功,版本已经成功迁移至 v2.0.0
请执行 1panel-migrator upgrade website 命令来升级网站
[root@jiaojiangbo tmp]# panel-migrator upgrade website
-bash: panel-migrator: command not found
[root@jiaojiangbo tmp]# cd /root/1panel-migrator/
[root@jiaojiangbo 1panel-migrator]# 1panel-migrator upgrade website

注意事项:
网站迁移前请务必阅读!

  1. 迁移完成后,所有网站配置将保存至 {1Panel 安装目录}/www
  2. OpenResty 将升级至 1.27.1.2-0-1-focal
  3. 迁移操作会重置 OpenResty 主配置文件,如有自定义修改,请提前备份
  4. 迁移操作会重置 OpenResty 00.default.conf 会取消默认的 default_server 可以在升级之后用 v1 的 00.default.conf 文件替换,
  5. PHP 运行环境将被移除(已创建网站中的 PHP 容器不会删除,但会迁移为静态网站)
  6. V2 版本迁移成功后,可在网站设置中将迁移的静态网站切换为 PHP 网站
  7. 因反代缓存机制已重构,所有网站的反代缓存将会关闭,请升级之后重新打开

迁移期间网站将不可访问,请确认风险后继续操作。
是否确认迁移网站? (y/n): y
再次确认:确定要升级网站吗? (y/n): y
正在升级网站…
2025/07/10 17:58:12 应用商店状态正常
2025/07/10 17:58:12 下载 Openresty https://apps-assets.fit2cloud.com/stable/1panel/openresty/1.27.1.2-0-1-focal/openresty-1.27.1.2-0-1-focal.tar.gz 到 /tmp/openresty.tar.gz
2025/07/10 17:58:21 开启拉取 Openresty 镜像 1panel/openresty:1.27.1.2-0-1-focal 请等待
1.27.1.2-0-1-focal: Pulling from 1panel/openresty
d9802f032d67: Pull complete
25defb16ae6e: Pull complete
e5b0f3eb3e16: Pull complete
e79a686cd1be: Pull complete
db1c5d2210b2: Pull complete
df991a36f66d: Pull complete
a0ff281ddbf4: Pull complete
57462a64fc11: Pull complete
6f6c228b0269: Pull complete
86201f8a3660: Pull complete
3ce6057e763d: Pull complete
5beb1b66329a: Pull complete
f336f0e8f4d8: Pull complete
Digest: sha256:c6ae4bc3392115d0778697047e05b3a87eff73c5d12895d3786f17ba21515bf4
Status: Downloaded newer image for 1panel/openresty:1.27.1.2-0-1-focal
docker.io/1panel/openresty:1.27.1.2-0-1-focal
2025/07/10 18:00:09 docker-compose down executed successfully
2025/07/10 18:00:09 备份 V1 Openresty 到 /opt/1panel/backup/openresty 目录
2025/07/10 18:00:11 备份 V1 Openresty 成功
2025/07/10 18:00:11 开始迁移网站目录
2025/07/10 18:00:11 迁移网站 www 目录到 /opt/1panel/www 目录
2025/07/10 18:00:11 迁移网站 www 目录成功
2025/07/10 18:00:11 迁移 Openresty conf.d 目录成功
2025/07/10 18:00:11 未找到匹配的目录
2025/07/10 18:00:11 开始升级 Openresty
2025/07/10 18:00:11 解压 Openresty
2025/07/10 18:00:14 移动 Openresty 目录 /tmp/openresty/1.27.1.2-0-1-focal 到 /opt/1panel/apps/openresty/openresty
2025/07/10 18:00:21 拷贝 Openresty .env
2025/07/10 18:00:21 处理 WAF 配置
2025/07/10 18:00:21 启动 Openresty …
2025/07/10 18:00:42 docker-compose up -d executed successfully
2025/07/10 18:00:42 启动 Openresty 成功
2025/07/10 18:00:43 升级 Openresty 成功

二、升级完openresty在不停的重启,网站无法访问,这是openresty的日志

wanzghan | 2025/07/10 18:43:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | 2025/07/10 18:43:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | 2025/07/10 18:43:53 [emerg] 1#1: a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [emerg] a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | 2025/07/10 18:44:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:2

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:2

wanzghan | 2025/07/10 18:44:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:3

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:3

wanzghan | 2025/07/10 18:44:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | 2025/07/10 18:44:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | 2025/07/10 18:44:53 [emerg] 1#1: a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [emerg] a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | 2025/07/10 18:45:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:2

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:2

wanzghan | 2025/07/10 18:45:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:3

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:3

wanzghan | 2025/07/10 18:45:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:6

wanzghan | 2025/07/10 18:45:53 [warn] 1#1: the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | 2025/07/10 18:45:53 [emerg] 1#1: a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

wanzghan | nginx: [emerg] a duplicate listen [::]:443 in /usr/local/openresty/nginx/conf/conf.d/xiaobu.asia.conf:7

看一下 /opt/1panel/www/conf.d/xiaobu.asia.conf 配置文件中 是否有多个 listen [::]:443