Skip to content

Commit

Permalink
Fix upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Aug 24, 2023
1 parent 4576437 commit a335f66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions cmd/internal/database/meilisearch/meilisearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deploy/meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a335f66

Please sign in to comment.