ThingsBoard - 版本升级(三)

425 阅读1分钟
1、  thingsboard-3.8.1版本安装

ThingsBoard - 源码打包部署文档

juejin.cn/post/745568…

juejin.cn/post/745602…

1、打开 thingsboard源码 选择 3.8.1 版本,进行打包编译

2、将thingsboard-3.8.1-boot.jar上传到我们的服务器

3、创建数据库thingsboard

4、初始化安装数据库
java -classpath thingsboard-3.8.1-boot.jar -Dspring.config.location=/opt/project/thingsboard-3.8.1/conf/thingsboard.yml -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication -Dinstall.data_dir=/opt/project/thingsboard-3.8.1/data org.springframework.boot.loader.launch.PropertiesLauncher
2、  通过 jar 包启动 thingsboard
java -classpath thingsboard-3.8.1-boot.jar -Dspring.config.location=/opt/project/thingsboard-3.8.1/conf/thingsboard.yml -Dlogging.config=/opt/project/thingsboard-3.8.1/conf/logback.xml -Dpkg.logFolder=/opt/project/thingsboard-3.8.1/logs -Dpkg.name=thingsboard org.springframework.boot.loader.launch.PropertiesLauncher

账号:sysadmin@thingsboard.org 密码:sysadmin image.png

3、  升级数据库
java -classpath thingsboard-3.9.0-boot.jar -Dspring.config.location=/opt/project/thingsboard/conf/thingsboard.yml -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication -Dinstall.upgrade=true -Dinstall.upgrade.from_version=3.8.1 -Dinstall.data_dir=/opt/project/thingsboard/data -Dspring.jpa.hibernate.ddl-auto=none -Dlogging.config=/opt/project/thingsboard/conf/logback.xml  -Dpkg.logFolder=/opt/project/thingsboard/logs -Dpkg.name=thingsboard org.springframework.boot.loader.launch.PropertiesLauncher

image.png

4、  启动升级后的 jar
java -classpath thingsboard-3.9.0-boot.jar -Dspring.config.location=/opt/project/thingsboard/conf/thingsboard.yml -Dlogging.config=/opt/project/thingsboard/conf/logback.xml -Dpkg.logFolder=/opt/project/thingsboard/logs -Dpkg.name=thingsboard org.springframework.boot.loader.launch.PropertiesLauncher

image.png

5、代码升级

如果都在同一个 git 下,可以 image.png 如果在官网同分支开发的话,进行合并一下即可 image.png 如果 git 地址跟官方源码不在一起,则需要拉取官方源码,进行合并即可

1、git remote add target_branch https://github.com/thingsboard/thingsboard.git 
2、git fetch target_branch
3、 git checkout -b target_branch_in_source target_branch/release-3.9
4、 切换分支到my-3.8.1(自己的分支)
5、 git merge --no-ff target_branch_in_source --allow-unrelated-histories
6、git commit -m "3.8.1版本升级3.9.0"
7、git push origin my-3.8.1   
6、视频地址

t.bilibili.com/10188515363…