Add Snapshot Restore command
Created by: jac
Snapshot Restore generates commands to restore dumped snapshots to a Sourcegraph instance
Usage: After generating a dump the restore commands can be generated with
src snapshot restore <docker|kubectlpg_dump>
The --run
command can be used to attempt to automatically run these commands. Useful e.g. in the AMIs e.g.
src snapshot restore --run <docker|kubectlpg_dump>
- Changed snapshot args ordering
- To get the --run flag to work it was necessary to change arg ordering as Go's flag package requires all flags come before non flag args
src snapshot databases docker --run
# changes to
src snapshot databases --run docker
- Removed the -t flags from <docker|kubectl> exec
- afaik only -i should be necessary for input/output redirection. Without -t we get better compatibility (prevents
device is not a TTY error
)
- afaik only -i should be necessary for input/output redirection. Without -t we get better compatibility (prevents
Test plan
- Generated snapshots using the snapshot tool and then restored them to another instance (running the same Sourcegraph version)