Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 83b34b1

Browse files
committed
docs: Document a way to back up and restore all devstack volumes
`make dev.backup` doesn't get everything, and is always at risk of being outdated. There are several barriers to using this approach on Mac, including an outdated version of rsync, but it could be expanded in the future.
1 parent 03d9635 commit 83b34b1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/workflow.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ Database backups
5454

5555
You can routinely create backups of your local databases. To create a backup, use ``make dev.backup``. When you want to restore you database to the backup, run ``make dev.restore``. Warning, this will restore all your databases. You might have to cycle the database containers off and on using ``make dev.down.<database service name>`` and ``make dev.up.<database service name>``.
5656

57+
Comprehensive backup
58+
~~~~~~~~~~~~~~~~~~~~
59+
60+
You can also back up and restore *all* devstack-related volumes -- not just databases, but also node_modules and static assets volumes. (These commands currently only work on Linux.)
61+
62+
- Back up: ``make stop && sudo rsync -savx --numeric-ids --include='/devstack_***' --exclude='*' --delete /var/lib/docker/volumes/ .dev/backups/2023-07-18/``
63+
- Restore: ``make stop && sudo rsync -savx --numeric-ids --include='/devstack_***' --exclude='*' --delete .dev/backups/2023-07-18/ /var/lib/docker/volumes/``
64+
65+
The above example creates and restores from a backup directory named ``2023-07-18`` and assumes that you're working from the master branch; if you're working from a named release or have explicitly specified an alternative ``COMPOSE_PROJECT_NAME``, you'll need to adjust the ``--include`` parameter.
66+
67+
Containers should be stopped before the backup or restore is performed, or databases are very likely to become corrupted.
68+
5769
Running micro-frontends outside of devstack
5870
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5971

0 commit comments

Comments
 (0)