Backup white/black lists

I would like to have an option to backup my whitelist and blacklist, so they could be restored during a complete reinstall.

A simple button click/file system dialog box option would be lovely. Generally, I just TeamViewer into the box and use MC to copy the files to Dropbox (cloud backup and I get to share my white/blacklists with a buddy who also runs an instance.).

1 Like

I have the Pi-hole Takeout feature (what you call Backup) already finished. However, the web-based restoring is something that still needs some more work.

Lovely. Can't wait to see it. If you need a tester (as I manually backup anyway) let me know?

Testing would be appreciated. You can try and checkout the new/takeout branch if you want to test it. If you are less experienced with git and want assistance for doing this, I can guide you through the necessary steps.

I would be glad to. But my Git powers are weak. Your help would be kindly appreciated.

Okay, let me see if I can put that together...

cd /var/www/html/admin
git remote set-branches origin new/takeout
git fetch origin new/takeout
git checkout new/takeout

This will also add all recent development implementations to your web interface so it is quite likely some things will not work afterwards (since you are missing the corresponding changes in the Pi-hole core repo).

You can always go back to the "normal" installation using:

cd /var/www/html/admin
git checkout master

I will get right on that tomorrow. Not really in a "productivity mode" right now.

Take your time - no need to rush. We are currently targeting for a release and most likely this feature has to wait for the next release (which should not be too far away, too) to allow proper testing.

I use a bash script to backup my blacklist to github weekly:

Note: both my Git and bash powers are weak :wink:

We process a lot with gravity.sh and strip out duplicates/blank lines/comments already so you may be able to just pass in the list and let the Pi-hole do the processing. The benefit with using GitHub is you can add https://raw.githubusercontent.com/rzsykzmxpxzasqxtyxlveeanfu/pi-hole-blacklist/master/blacklist.txt to the adlists user file and have gravity source the list for you. The blacklist.txt file was mainly designed to hold a handful of sites that were needed for customization and for a list to be made for larger implementations.