From 5ad2d59b3bdb15e5ee34471ae36f53b0f0660588 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 14 Nov 2017 00:21:19 +0100 Subject: [PATCH] Add note about backup/restore --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d4a230..7073094 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,6 @@ ssh admin@portal.example.org host inspect toto You can enter in interactive mode using this syntax: `ssh admin@portal.example.org` - ### Synopsis ```sh @@ -199,3 +198,27 @@ Get the latest version using GO (recommended way): ```sh go get -u github.com/moul/sshportal ``` + +## Backup / Restore + +sshportal embeds built-in backup/restore methods which basically import/export JSON objects: + +```sh +# Backup +ssh admin@sshportal config backup > sshportal.bkp + +# Restore +ssh admin@sshportal config restore < sshporta.bkp +``` + +This method is particularly useful as it should be resistant against future DB schema changes (expected during development phase). + +I suggest you to be careful during this development phase, and use an additional backup method, for example: + +```sh +# sqlite dump +sqlite3 sshportal.db .dump > sshportal.sql.bkp + +# or just the immortal cp +cp sshportal.db sshportal.db.bkp +```