Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Backup guide #194

Closed
geerlingguy opened this issue Aug 8, 2021 · 11 comments
Closed

Create Backup guide #194

geerlingguy opened this issue Aug 8, 2021 · 11 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request stale

Comments

@geerlingguy
Copy link
Owner

geerlingguy commented Aug 8, 2021

See #7.

For backup for Pi-hole at least, in the GUI you can go to Settings > Teleporter and click 'Backup'. To automate it through the console, you can run pihole -a -t (can I integrate it with something like my geerlingguy.backup role?).

If I run docker-compose exec pihole /bin/bash pihole -a -t it exports a file inside the container. docker-compose cp is not a supported command yet (see docker/compose#3593), so will have to figure out the best way of scripting this... maybe something like:

  1. Create a /backup directory inside the container (mkdir -p /backup).
  2. Run the pihole -a -t command inside the /backup directory.
  3. Cat the contents of /backup/[latest-file-with-extension].tar.gz and pipe them to file on host.
  4. Delete contents of /backup directory (rm -rf /backup/*).

It would be convenient for the pihole -a -t command to have an option to output the archive to shell instead of into a file, that would save the whole file-based annoying process.

@geerlingguy geerlingguy added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 8, 2021
@geerlingguy
Copy link
Owner Author

I would also like to make it so you could backup the Prometheus data as well, from the configured Docker volume.

@Jatidude
Copy link

You could mount that /backup folder as a volume in your docker compose, so the host has access to the files there without needing your step 3.

Your script could docker-compose exec pihole -a -t into the /backup volume mounted and then you can rsync it off somewhere or whatever other backup method that you want.

@shawnsBrain
Copy link

@jrwagz
Copy link

jrwagz commented Jan 7, 2022

Another simple example, is just to store all data that you want to easily backup into a volume, and then you can easily script the export of those volumes through another temporary container that you spin up just for the purposes of data-exporting.

https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes

@Beutelwolf
Copy link

Another way would be to map all volumes you want to backup to your host and then use a dedicated backup client container like duplicati

https://hub.docker.com/r/duplicati/duplicati/

to manage your backup.

@stale
Copy link

stale bot commented Jul 31, 2022

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

1 similar comment
@stale
Copy link

stale bot commented Nov 1, 2022

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Nov 1, 2022
@stale
Copy link

stale bot commented Dec 24, 2022

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@dracostheblack
Copy link

dracostheblack commented Jul 16, 2023

@geerlingguy it looks like Prometheus has the ability to create snapshots for backup but you need the admin api enabled https://prometheus.io/docs/prometheus/latest/querying/api/#snapshot. How can we do that through the configuration?

Was using this to back up grafana to s3 https://github.com/ysde/grafana-backup-tool, just need the data now to complete it i think.

@github-actions github-actions bot removed the stale label Sep 18, 2023
Copy link

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@github-actions github-actions bot added the stale label Jun 24, 2024
Copy link

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

6 participants