halo博客系统1.4升级到1.5踩坑记录

Posted 乡下的树

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了halo博客系统1.4升级到1.5踩坑记录相关的知识,希望对你有一定的参考价值。

距离 2020 年 9 月 24 号发布 1.4.0 已经过去了 545 天了,期间虽然有一些版本更新,但大多数都是 patch 修复版本。终于,在2022.03.22正式发布1.5.0 版本。

迫不及待,立马从halo1.4升级1.5版本,但启动失败了~~~

日志记录如下

2022-03-25 17:06:03.847  INFO 10872 --- [main] run.halo.app.Application                 : Starting Application v1.5.0 using Java 17.0.1 on 10_0_20_10 with PID 10872 (C:\\itdo\\app\\halo\\halo-1.5.0.jar started by gou_dan in C:\\itdo\\app\\halo)
2022-03-25 17:06:03.882 INFO 10872 --- [main] run.halo.app.Application : No active profile set, falling back to 1 default profile: "default"
2022-03-25 17:06:06.921 INFO 10872 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-03-25 17:06:06.934 INFO 10872 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-03-25 17:06:07.463 INFO 10872 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 503 ms. Found 24 JPA repository interfaces.
2022-03-25 17:06:09.498 INFO 10872 --- [main] org.eclipse.jetty.util.log : Logging initialized @9352ms to org.eclipse.jetty.util.log.Slf4jLog
2022-03-25 17:06:10.038 INFO 10872 --- [main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
2022-03-25 17:06:10.062 INFO 10872 --- [main] org.eclipse.jetty.server.Server : jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 17.0.1+12-LTS-39
2022-03-25 17:06:10.172 INFO 10872 --- [main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2022-03-25 17:06:10.183 INFO 10872 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6045 ms
2022-03-25 17:06:12.931 INFO 10872 --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-03-25 17:06:13.025 INFO 10872 --- [main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.33
2022-03-25 17:06:13.124 INFO 10872 --- [main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations 5.1.2.Final
2022-03-25 17:06:13.319 INFO 10872 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-03-25 17:06:13.725 INFO 10872 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-03-25 17:06:13.775 INFO 10872 --- [main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2022-03-25 17:06:16.168 INFO 10872 --- [main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-03-25 17:06:16.194 INFO 10872 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit default
2022-03-25 17:06:17.682 INFO 10872 --- [main] run.halo.app.config.HaloConfiguration : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
2022-03-25 17:06:18.975 INFO 10872 --- [main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2022-03-25 17:06:18.987 INFO 10872 --- [main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2022-03-25 17:06:19.004 INFO 10872 --- [main] org.eclipse.jetty.server.session : node0 Scavenging every 600000ms
2022-03-25 17:06:19.044 INFO 10872 --- [main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@698d6d30application,/,[file:///C:/Users/gou_dan/AppData/Local/Temp/2/jetty-docbase.8090.6694525887972989422/, jar:file:/C:/itdo/app/halo/halo-1.5.0.jar!/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE
2022-03-25 17:06:19.068 INFO 10872 --- [main] org.eclipse.jetty.server.Server : Started @18923ms
2022-03-25 17:06:22.410 INFO 10872 --- [main] run.halo.app.handler.file.FileHandlers : Registered 9 file handler(s)
2022-03-25 17:06:26.121 INFO 10872 --- [main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path /api/admin/actuator
2022-03-25 17:06:26.241 INFO 10872 --- [main] o.e.j.s.h.ContextHandler.application : Initializing Spring DispatcherServlet dispatcherServlet
2022-03-25 17:06:26.251 INFO 10872 --- [main] o.s.web.servlet.DispatcherServlet : Initializing Servlet dispatcherServlet
2022-03-25 17:06:26.274 INFO 10872 --- [main] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
2022-03-25 17:06:26.299 INFO 10872 --- [main] o.e.jetty.server.AbstractConnector : Started ServerConnector@5fb97279HTTP/1.1, (http/1.1)0.0.0.0:8090
2022-03-25 17:06:26.310 INFO 10872 --- [main] o.s.b.web.embedded.jetty.JettyWebServer : Jetty started on port(s) 8090 (http/1.1) with context path /
2022-03-25 17:06:26.377 INFO 10872 --- [main] run.halo.app.Application : Started Application in 24.801 seconds (JVM running for 26.232)
2022-03-25 17:06:26.393 INFO 10872 --- [main] run.halo.app.listener.StartedListener : Starting migrate database...
2022-03-25 17:06:26.510 INFO 10872 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 7.15.0 by Redgate
2022-03-25 17:06:26.524 INFO 10872 --- [main] o.f.c.i.database.base.BaseDatabaseType : Database: jdbc:h2:file:~/.halo/db/halo (H2 1.4)
2022-03-25 17:06:26.619 INFO 10872 --- [main] o.f.c.i.s.JdbcTableSchemaHistory : Repair of failed migration in Schema History table "PUBLIC"."flyway_schema_history" not necessary. No failed migration detected.
2022-03-25 17:06:26.665 INFO 10872 --- [main] o.f.core.internal.command.DbRepair : Successfully repaired schema history table "PUBLIC"."flyway_schema_history" (execution time 00:00.067s).
2022-03-25 17:06:26.686 INFO 10872 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 7.15.0 by Redgate
2022-03-25 17:06:26.765 INFO 10872 --- [main] o.f.core.internal.command.DbValidate : Successfully validated 12 migrations (execution time 00:00.046s)
2022-03-25 17:06:26.854 INFO 10872 --- [main] o.f.core.internal.command.DbMigrate : Current version of schema "PUBLIC": 4
2022-03-25 17:06:26.903 INFO 10872 --- [main] o.f.core.internal.command.DbMigrate : Migrating schema "PUBLIC" to version "5 - migrate remove notnull for email in comments table"
2022-03-25 17:06:27.065 INFO 10872 --- [main] o.f.core.internal.command.DbMigrate : Migrating schema "PUBLIC" to version "6 - migrate create contents table"
2022-03-25 17:06:27.094 ERROR 10872 --- [main] o.f.core.internal.command.DbMigrate : Migration of schema "PUBLIC" to version "6 - migrate create contents table" failed! Please restore backups and roll back database and code!
2022-03-25 17:06:27.184 INFO 10872 --- [main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with debug enabled.
2022-03-25 17:06:27.284 ERROR 10872 --- [main] o.s.boot.SpringApplication : Application run failed

org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V6__migrate_create_contents_table.sql failed
------------------------------------------------------
SQL State : 23505
Error Code : 23505
Message : Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [1, TIMESTAMP 2022-01-06 10:14:19.529, TIMESTAMP 2022-01-07 10:39:54.681, SPACE(6969 /* table: 94 id: 320297 */), 1, SPACE(6475 /* table: 94 id: 320298 */), 1, 0]"; SQL statement:
-- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts [23505-199]
Location : migration/V6__migrate_create_contents_table.sql (C:\\itdo\\app\\halo\\file:\\C:\\itdo\\app\\halo\\halo-1.5.0.jar!\\BOOT-INF\\classes!\\migration\\V6__migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts

at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:378) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:271) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:270) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:243) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate$1.call(TableLockingExecutionTemplate.java:38) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate.execute(TableLockingExecutionTemplate.java:33) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:103) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:101) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.Flyway$1.execute(Flyway.java:219) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.Flyway$1.execute(Flyway.java:170) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.Flyway.execute(Flyway.java:586) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.Flyway.migrate(Flyway.java:170) ~[flyway-core-7.15.0.jar!/:na]
at run.halo.app.listener.StartedListener.migrate(StartedListener.java:123) ~[classes!/:1.5.0]
at run.halo.app.listener.StartedListener.onApplicationEvent(StartedListener.java:76) ~[classes!/:1.5.0]
at run.halo.app.listener.StartedListener.onApplicationEvent(StartedListener.java:47) ~[classes!/:1.5.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.16.jar!/:5.3.16]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.16.jar!/:5.3.16]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.16.jar!/:5.3.16]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.16.jar!/:5.3.16]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.16.jar!/:5.3.16]
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:105) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplicationRunListeners.lambda$started$5(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.10.jar!/:2.5.10]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) ~[spring-boot-2.5.10.jar!/:2.5.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.10.jar!/:2.5.10]
at run.halo.app.Application.main(Application.java:21) ~[classes!/:1.5.0]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[halo-1.5.0.jar:1.5.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[halo-1.5.0.jar:1.5.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[halo-1.5.0.jar:1.5.0]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[halo-1.5.0.jar:1.5.0]
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V6__migrate_create_contents_table.sql failed
------------------------------------------------------
SQL State : 23505
Error Code : 23505
Message : Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [1, TIMESTAMP 2022-01-06 10:14:19.529, TIMESTAMP 2022-01-07 10:39:54.681, SPACE(6969 /* table: 94 id: 320297 */), 1, SPACE(6475 /* table: 94 id: 320298 */), 1, 0]"; SQL statement:
-- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts [23505-199]
Location : migration/V6__migrate_create_contents_table.sql (C:\\itdo\\app\\halo\\file:\\C:\\itdo\\app\\halo\\halo-1.5.0.jar!\\BOOT-INF\\classes!\\migration\\V6__migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts

at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:277) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:224) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:128) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:78) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:67) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:66) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:370) ~[flyway-core-7.15.0.jar!/:na]
... 42 common frames omitted
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [1, TIMESTAMP 2022-01-06 10:14:19.529, TIMESTAMP 2022-01-07 10:39:54.681, SPACE(6969 /* table: 94 id: 320297 */), 1, SPACE(6475 /* table: 94 id: 320298 */), 1, 0]"; SQL statement:
-- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts [23505-199]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:457) ~[h2-1.4.199.jar!/:na]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) ~[h2-1.4.199.jar!/:na]
at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.199.jar!/:na]
at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.199.jar!/:na]
at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:131) ~[h2-1.4.199.jar!/:na]
at org.h2.mvstore.db.MVTable.addRow(MVTable.java:546) ~[h2-1.4.199.jar!/:na]
at org.h2.command.dml.Insert.addRowImpl(Insert.java:251) ~[h2-1.4.199.jar!/:na]
at org.h2.command.dml.Insert.insertRows(Insert.java:207) ~[h2-1.4.199.jar!/:na]
at org.h2.command.dml.Insert.update(Insert.java:132) ~[h2-1.4.199.jar!/:na]
at org.h2.command.CommandContainer.update(CommandContainer.java:133) ~[h2-1.4.199.jar!/:na]
at org.h2.command.Command.executeUpdate(Command.java:267) ~[h2-1.4.199.jar!/:na]
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:233) ~[h2-1.4.199.jar!/:na]
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:205) ~[h2-1.4.199.jar!/:na]
at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:241) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:111) ~[flyway-core-7.15.0.jar!/:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212) ~[flyway-core-7.15.0.jar!/:na]
... 48 common frames omitted

2022-03-25 17:06:28.145 INFO 10872 --- [main] o.e.jetty.server.AbstractConnector : Stopped ServerConnector@5fb97279HTTP/1.1, (http/1.1)0.0.0.0:8090
2022-03-25 17:06:28.158 INFO 10872 --- [main] org.eclipse.jetty.server.session : node0 Stopped scavenging
2022-03-25 17:06:28.175 INFO 10872 --- [main] o.e.j.s.h.ContextHandler.application : Destroying Spring FrameworkServlet dispatcherServlet
2022-03-25 17:06:28.190 INFO 10872 --- [main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@698d6d30application,/,[file:///C:/Users/gou_dan/AppData/Local/Temp/2/jetty-docbase.8090.6694525887972989422/, jar:file:/C:/itdo/app/halo/halo-1.5.0.jar!/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED
2022-03-25 17:06:28.244 INFO 10872 --- [main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit default
2022-03-25 17:06:28.262 INFO 10872 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2022-03-25 17:06:28.287 INFO 10872 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

halo博客系统1.4升级到1.5踩坑记录_halo

查看数据库flyway_schema_history 表的信息

开启 h2-console

可将web-allow-others和enabled 设为 true 来开启 h2 控制台,访问路径为 ip:端口/h2-console。JDBC URL,username,password 使用配置文件中的即可。

注意:在开启 h2-console 并完成所需操作之后,一定要再次关闭 h2-console 并重启,不要长时间将 h2-console 处于开启状态,这可能会有隐性的安全风险。

halo博客系统1.4升级到1.5踩坑记录_halo_02


SELECT * FROM "flyway_schema_history";

halo博客系统1.4升级到1.5踩坑记录_halo_03

将installed_rank字段的7、8、9、10条删除后,再重新运行即可正常启动

halo博客系统1.4升级到1.5踩坑记录_halo_04

原因:用1.4升级到了1.5之后又运行了1.4 版本,然后再运行1.5版本会又一次触发执行迁移脚本,才会导致这样的问题。

异常2:

升级1.5后,切换运行回1.4版本,然后在1.4版本期间创建的文章,运行回1.5版本后无法查看访问,提示content was not found or has deleted,但是切换回1.4版本可正常访问。

halo博客系统1.4升级到1.5踩坑记录_halo_05

halo博客系统1.4升级到1.5踩坑记录_halo_06

解决:切换回1.4版本,将期间无法访问的文章备份导出,然后重新运行1.5版本,导入即可。

异常3:

更新1.5版本后,进行某些操作后(例如删除分类),文章内容和状态会发生回退,状态由已发布变为草稿,然后已经删除的文章会再次回到所有文章的列表

halo博客系统1.4升级到1.5踩坑记录_halo_07

halo博客系统1.4升级到1.5踩坑记录_halo_08

查询得到官方解释:由于发布、草稿、回收站及私密状态都是使用的一个status字段来存储,导致例如文章所属私密分类然后更改为非私密分类这样的操作无法回退到原来的状态只能统一改为草稿,目前1.5及后续版本都不会进行大的更改所以这个问题只能等待2.0版本了

以上是关于halo博客系统1.4升级到1.5踩坑记录的主要内容,如果未能解决你的问题,请参考以下文章

征文投稿丨使用云服务器ECS快速搭建halo博客

halo 1.4.17 使用Mysql 安装与配置

halo 1.4.17 使用Mysql 安装与配置

云原生之kubernetes实战在k8s环境下部署Halo博客系统

用Halo在自己服务器搭建一个个人博客

Web开发docker+halo搭建个人博客