diff --git a/cmd/internal/database/meilisearch/meilisearch.go b/cmd/internal/database/meilisearch/meilisearch.go index 2b0e10f..620d192 100644 --- a/cmd/internal/database/meilisearch/meilisearch.go +++ b/cmd/internal/database/meilisearch/meilisearch.go @@ -163,8 +163,15 @@ func (db *Meilisearch) Upgrade() error { db.log.Infow("start upgrade", "from", dbVersion, "to", meilisearchVersion) - // meilisearch --import-dump /dumps/20200813-042312213.dump - cmd := exec.Command(meilisearchCmd, "--ignore-dump-if-db-exists", "--import-dump", path.Join(db.dumpdir, latestStableDump), "--master-key", db.apikey) // nolint:gosec + err = os.Rename(db.dbdir, db.dbdir+".old") + if err != nil { + return fmt.Errorf("unable to rename dbdir: %w", err) + } + + args := []string{"--ignore-dump-if-db-exists", "--import-dump", path.Join(db.dumpdir, latestStableDump), "--master-key", db.apikey} + db.log.Infow("execute meilisearch", "args", args) + + cmd := exec.Command(meilisearchCmd, args...) // nolint:gosec cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr err = cmd.Run() diff --git a/deploy/meilisearch.yaml b/deploy/meilisearch.yaml index 6fd4444..30062c9 100644 --- a/deploy/meilisearch.yaml +++ b/deploy/meilisearch.yaml @@ -22,7 +22,7 @@ spec: name: auditing-meili-meilisearch-environment - secretRef: name: metal-auditing-master-key - image: getmeili/meilisearch:v1.3.1 + image: getmeili/meilisearch:v1.2.0 imagePullPolicy: IfNotPresent name: meilisearch command: @@ -89,7 +89,7 @@ spec: - name: bin-provision subPath: tini mountPath: /usr/local/bin/tini - - image: getmeili/meilisearch:v1.3.1 + - image: getmeili/meilisearch:v1.2.0 name: backup-restore-sidecar command: - tini