diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go index 85c1f586b..95adf5c7c 100644 --- a/api/cmd/portainer/main.go +++ b/api/cmd/portainer/main.go @@ -107,11 +107,6 @@ func initDataStore(flags *portainer.CLIFlags, secretKey []byte, fileService port if isNew { // from MigrateData store.VersionService.StoreDBVersion(portainer.DBVersion) - - err := updateSettingsFromFlags(store, flags) - if err != nil { - log.Fatalf("Failed updating settings from flags: %v", err) - } } else { storedVersion, err := store.VersionService.DBVersion() if err != nil { @@ -125,6 +120,11 @@ func initDataStore(flags *portainer.CLIFlags, secretKey []byte, fileService port } } + err = updateSettingsFromFlags(store, flags) + if err != nil { + log.Fatalf("Failed updating settings from flags: %v", err) + } + // this is for the db restore functionality - needs more tests. go func() { <-shutdownCtx.Done()