Pi-hole 5.0 how to keep multiple instances in sync?

Hi all. Thanks to all the contributor's to this project.

I had a question as i start planning mirgrating to 5.0. I am running multiple instances of PiHole and syncing blacklist/whitelist files one way using rsycn.

black.list
blacklist.txt
regex.list
whitelist.txt
lan.list
adlists.list
gravity.list

After the sync was done i would either restart

service pihole-FTL restart

or run

pihole -g --skip-download

based on the files that got updated. So i can curious with 5.0 moving to new method of stroring files in a gravity db. Does any one have any pointers as to how i could acvieve keeping 2 instances in sync if they were both on 5.0?

The documentation for the new database provides some detail on manipulating the database, as discussed in the release announcement. See this section:

https://docs.pi-hole.net/database/gravity/example/

However, the easiest approach (since you only want a one-way file transfer), is to move the database at /etc/pihole/gravity.db from one Pi to the other, then restart FTL on the destination Pi.

1 Like

Thanks @jfb will checkout the db reference.

@jfb would it ok to sync the etc/pihole/custom.list as well? Today i add the mapping in my docker-compose file for /etc/hosts and then manually sync the new entries to the other node. If i switch to using this new custom list it could make some of my setup easier.

There should be no reason this won't work. Restart FTL after you make the changes on the receiving Pi-hole.