home/versioned_docs/version-1.8.0/start/update-1.6.0.md
:::note
This guide is applicable for upgrading from 1.5.0 to 1.6.0 to version 1.6.0.
If you are using an older version, it is recommended to reinstall using the export function, or upgrade to 1.5.0 and then follow this guide to 1.6.0.
:::
Follow the HertzBeat New Version Upgrade
Since version 1.6.0 uses Java 17 and the installation package no longer provides a built-in JDK version, use the new HertzBeat according to the following situations:
java, then copy it to the HertzBeat extraction directory.Go to https://github.com/apache/hertzbeat/tree/master/hertzbeat-startup/src/main/resources/db/migration, choose the directory of your database and execute the corresponding V160__update_column.sql file for the upgrade SQL.
Due to significant changes in application.yml and sureness.yml, it is recommended to directly use the new yml configuration files and then modify them based on your own needs.
application.yml generally needs to modify the following partsDefault is:
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
If you change to a MySQL database, here is an example:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
sureness.yml modification is optional, usually when you need to change account passwords# account info config
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
Due to the Apache Foundation's requirements for license compliance, HertzBeat's installation package cannot include dependencies with GPL licenses such as MySQL, Oracle, etc. Users need to add them themselves. Users can download the drivers from the following links and copy them to the ext-lib directory of the installation:
Next, run the start-up script as before to experience the latest HertzBeat 1.6.0!
Stop the HertzBeat container:
docker stop hertzbeat
Upgrade the database script:
V160__update_column.sql file in MySQL.Upgrade the configuration files:
application.yml and sureness.yml, it is recommended to directly mount and use the new yml configuration files, and then modify them based on your own needs.Add the corresponding database drivers:
ext-lib directory, then mounting ext-lib to the container's /opt/hertzbeat/ext-lib directory when starting.Next, run HertzBeat using Docker as before to experience the latest HertzBeat 1.6.0!
Stop the HertzBeat container:
docker stop hertzbeat
Edit the H2 database files:
Assuming you have mounted the H2 database files in the data directory to the local system, or copied the /opt/hertzbeat/data directory from the old container manually.
Download the H2 driver jar from https://mvnrepository.com/artifact/com.h2database/h2/2.2.220.
Start the database locally using the H2 driver jar:
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
Upgrade the configuration files:
application.yml and sureness.yml, it is recommended to directly mount and use the new yml configuration files, and then modify them based on your own needs.Add the corresponding database drivers:
ext-lib directory, then mounting ext-lib to the container's /opt/hertzbeat/ext-lib directory when starting.Next, run the Docker to start HertzBeat as before to experience the latest HertzBeat 1.6.0!
If you do not want to go through the tedious script upgrade method mentioned above, you can directly export and import the monitoring tasks and threshold information from the old environment.