I forked this .lando.yml file from @BWPanda with a special snapshot command that creates a snapshot of the database, files, and config with the ability to restore them later. 

DDEV has it's own `ddev snapshot` and `ddev snapshot restore` commands. But, I don't think these accout for config files and files directory. They do snapshot and restore the database.

Has anyone done a work-a-round for this or figure out how to do a snapshot that includes files and config? 

NOTE: For folks who don't know what DDEV is, it is a tool for working on your Backdrop CMS site locally (on your desktop or laptop) that a lot of full time developers use. It's not required to use anything like DDEV for Backdrop, but it can be very helpful. https://ddev.com/


It's a good question and would be very useful to have documented.

In your lando file, you define the bee command under tooling, and then a little further down you define the snapshot command. For DDEV, the instructions for installing bee are here. I haven't tested but I would think that you could follow the steps for #2 in that instruction and define a new command that mirrors the Lando snapshot tooling to also capture the active config directory. I'd recommend naming it differently than DDEV's core snapshot command. This would be something like .ddev/commands/web/backup containing something like:

#!/usr/bin/env bash

mysqldump --add-drop-database -Bu db -h db -P 3306 db > /var/www/html/backdrop.sql
gzip -f /var/www/html/backdrop.sql
cd /var/www/html/$DDEV_DOCROOT/files/config_* && tar -czf /var/www/html/$DDEV_DOCROOT/config.tar.gz active
echo 'Backup created successfully'

If you named the command as above, you should be able to use ddev backup to run this (after starting DDEV).

If you test this and tweak it please update here! You could do something similar to match the reset/restore functionality in the lando file.

One side note: if #2277 gets into core, it would allow config to be stored in the database. If configured this way, it would mean that the default snapshot command in DDEV would snapshot the active content and the config (but still not the files).