我正试图从H2迁移到postgres。这两个matebase的版本均为0.31.2 由于–字符22不存在“ public.databasechangeloglock”关系而导致迁移失败
全流量:
停止旧的配置数据库并将旧的db转储到本地
运行postgres容器
public extension Array where Element: Equatable {
@discardableResult
public mutating func remove(_ item: Element) -> Array {
if let index = firstIndex(where: { item == $0 }) {
remove(at: index)
}
return self
}
@discardableResult
public mutating func removeAll(_ item: Element) -> Array {
removeAll(where: { item == $0 })
return self
}
}
运行Metabase容器
docker run --rm --name pg-docker
-v $HOME/MetabaseDocker-V2/newDocker/data/new:/var/lib/postgresql/data
-e POSTGRES_USER=postgres
-e POSTGRES_PASSWORD=docker
-e POSTGRES_DB=postgres
-d -p 5432:5432 postgres
元数据库日志快照:
docker run -p 3000:3000 --name metabase
-v /Users/dshadab/MetabaseDocker-V2/newDocker/metabase-data:/metabase-data
-e MB_DB_FILE=/metabase-data/metabase.db
-e MB_DB_TYPE=postgres
-e MB_DB_PORT=5432
-e MB_DB_USER=postgres
-e MB_DB_PASS=docker
-e MB_DB_DBNAME=postgres
-e MB_DB_HOST=172.17.0.2
-e “JAVA_TOOL_OPTIONS=-Xmx4g”
-e MB_DB_AUTOMIGRATE=false
metabase/metabase load-from-h2
来自Postgres Log的SnapShot
Picked up JAVA_TOOL_OPTIONS: -Xmx4g
03-14 18:21:21 INFO metabase.util :: Loading Metabase…
03-14 18:21:21 INFO metabase.util :: Maximum memory available to JVM: 3.6 GB
03-14 18:21:28 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. :unlock:
For more information, see https://www.metabase.com/docs/latest/operations-guide/start.html#encrypting-your-database-connection-details-at-rest
03-14 18:21:40 INFO metabase.db :: Verifying postgres Database Connection …
03-14 18:21:40 INFO metabase.db :: Verify Database Connection … :white_check_mark:
03-14 18:21:40 INFO metabase.db :: Running Database Migrations…
03-14 18:21:40 INFO metabase.db :: Setting up Liquibase…
03-14 18:21:41 INFO metabase.db :: Liquibase is ready.
03-14 18:21:41 INFO metabase.db :: Checking if Database has unrun migrations…
03-14 18:21:43 INFO metabase.db :: Database has unrun migrations. Waiting for migration lock to be cleared…
03-14 18:21:43 INFO metabase.db :: Migration lock is cleared. Running migrations…
03-14 18:21:47 INFO metabase.db :: Database Migrations Current … :white_check_mark:
Temporarily disabling DB constraints…
[OK]
Transfering 1 instances of Database…[OK]
Transfering 8 instances of User…[OK]
Transfering 19 instances of Setting…[OK]
Transfering 80 instances of Dependency…[OK]
Transfering 21 instances of Table…[OK]
Transfering 1271 instances of Field…[OK]
Transfering 467 instances of FieldValues…[OK]
Transfering 12 instances of Segment…[OK]
Transfering 46 instances of Metric…[OK]
Transfering 618 instances of Revision…[OK]
Transfering 850 instances of ViewLog…[OK]
Transfering 157 instances of Session…[OK]
Transfering 2 instances of Dashboard…[OK]
Transfering 258 instances of Card…[OK]
Transfering 2 instances of DashboardCard…[OK]
Transfering 629 instances of Activity…[OK]
Transfering 5 instances of Pulse…[OK]
Transfering 26 instances of PulseCard…[OK]
Transfering 5 instances of PulseChannel…[OK]
Transfering 13 instances of PulseChannelRecipient…[OK]
Transfering 3 instances of PermissionsGroup…[OK]
Transfering 13 instances of PermissionsGroupMembership…[OK]
Transfering 43 instances of Permissions…[OK]
Transfering 27 instances of Collection…[OK]
Transfering 3371 instances of TaskHistory…[OK]
Transfering 14 instances of DataMigrations…[OK]
Setting postgres sequence ids to proper values…
[OK]
请并且建议。