From e4a0487ca0af71a6ea59c58cdcdb81fff22212e2 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 1 Mar 2021 14:36:50 +0100 Subject: [PATCH] Add backup/restore stuff Somehow got lost, probably my mistake. --- docs/backup-restore.md | 56 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/backup-restore.md b/docs/backup-restore.md index c25524b9..28512797 100644 --- a/docs/backup-restore.md +++ b/docs/backup-restore.md @@ -2,4 +2,58 @@ title: Back-up and restore an application --- -TODO. +We'll use the example of a [`coop-cloud/wordpress`][wordpress] app deployed at +`blog.example.com`. + +## Backing up + +``` +abra app wordpress_blog_example_com backup --all +``` + +This will download backups of the Wordpress files (plugins, themes, and uploads) +and database (posts, settings and users) to the default backup directory, +`~/.abra/backups`. + +You can also back up just the files: + +``` +abra app wordpress_blog_example_com backup app +``` + +or just the database: + +``` +abra app wordpress_blog_example_com backup db +``` + +!!! warnings +Not all types of apps know how to do backups yet -- if you see a message like +`ERROR: 'nextcloud' doesn't know how to do app backups`, then extra code is +needed in that app's `abra.sh` -- you might be able to add this yourself based +on [`coop-cloud/wordpress` `abra.sh`][wordpress_abra.sh], otherwise please +open a new issue (in this case for [`coop-cloud/nextcloud`][nextcloud]). + +## Restore + +You can restore data into a running application. This is useful to restore an +app to a previous state, to migrate an app from one Co-op Cloud server to +another, or to help move an app to Co-op Cloud initially. + +Using the same example app above, you can restore files: + +``` +abra app wordpress_blog_example_com restore blog_example_com_app.tar.gz +``` + +and/or the database: + +``` +abra app wordpress_blog_example_com restore blog_example_com_db.sql.gz +``` + +(there isn't yet a command to restore files and database data at the same time) + +[wordpress]: https://git.autonomic.zone/coop-cloud/wordpress +[wordpress_abra.sh]: https://git.autonomic.zone/coop-cloud/wordpress/src/branch/master/abra.sh +[nextcloud]: https://git.autonomic.zone/coop-cloud/nextcloud