diff --git a/cmd/internal/database/postgres/upgrade.go b/cmd/internal/database/postgres/upgrade.go index 2fde4c7..b08c2ac 100644 --- a/cmd/internal/database/postgres/upgrade.go +++ b/cmd/internal/database/postgres/upgrade.go @@ -19,6 +19,7 @@ import ( const ( postgresHBAConf = "pg_hba.conf" + postgresqlConf = "postgresql.conf" postgresConfigCmd = "pg_config" postgresUpgradeCmd = "pg_upgrade" postgresInitDBCmd = "initdb" @@ -137,14 +138,17 @@ func (db *Postgres) Upgrade() error { } db.log.Infow("new database directory initialized") - // restore old pg_hba.conf - pgHBAConf, err := os.ReadFile(path.Join(db.datadir, postgresHBAConf)) - if err != nil { - return err - } - err = os.WriteFile(path.Join(newDataDirTemp, postgresHBAConf), pgHBAConf, 0600) - if err != nil { - return err + // restore old pg_hba.conf and postgresql.conf + for _, config := range []string{postgresHBAConf, postgresqlConf} { + db.log.Infow("restore old configuration into new datadir", "config", config) + cfg, err := os.ReadFile(path.Join(db.datadir, config)) + if err != nil { + return err + } + err = os.WriteFile(path.Join(newDataDirTemp, config), cfg, 0600) + if err != nil { + return err + } } err = db.restoreOldPostgresBinaries(db.datadir, newDataDirTemp) diff --git a/docs/sequence.drawio b/docs/sequence.drawio index 7a8b920..f3936d8 100644 --- a/docs/sequence.drawio +++ b/docs/sequence.drawio @@ -1 +1,297 @@ -7V1tk6M2Ev41rrr7MC6ExNvHnZndbHKXq6mbu2TvUwob2VYGIw7wvOTXR8ICIwlssIXtnczUVq0RshDS091Pt1ryBN6tX3/IwnT1M41wPLGt6HUC7ye2DZBtT/g/K3rblvgB2hYsMxKJSruCR/IHFoWWKN2QCOdSxYLSuCCpXDinSYLnhVQWZhl9kastaCw/NQ2XWCt4nIexXvoriYqVKAWWtbvxFZPlSjzad8SNWTh/WmZ0k4jnTWy4KP+2t9dh1Zaon6/CiL40iuDnCbzLKC22n9avdzjmY1sN2/Z7Xzru1v3OcFL0+cLzt5//9Y/119XrT48P6dpf///XL8WNmKvnMN7g6jXKzhZv1QCVr4h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YjtvO1+jwN+/hM= \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/sequence.png b/docs/sequence.png index 61b177a..c61ef1c 100644 --- a/docs/sequence.png +++ b/docs/sequence.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e12e2a393beee105556fac72b054762e32ee90b36ab9fe63f69d4ed30eca9d0a -size 91035 +oid sha256:34f94f74c5fc184bc20c4046a498623f34a4adfd3f8acb634bb5d4daa5245dab +size 128206