Scripts to Bulk Build Database From Files

I manage a few piholes (2 at home, 1 on a personal VPN, and 1 for relatives). In older versions it was easy to manage and sync these pi's via a simple script that just downloaded a few files (adlists.list, regex.list, whitelist.txt) and replaced whatever was there and poof they were on the most curated list.

With the database, its a bit more complex. I cant seem to figure out how to keep everything in sync, and it looks like a lot of the effort is GUI based. Can you create a script that does the build process (similar to when you first upgrade to V5+) that people like me could use? It wouldn't have to be something that was exposed via GUI, but just a tool for us that want to use the backend / command lines to keep things up to date.

I understand you lose the per client rules and all that jazz, but efficiency of use to bulk update would be a life saver.

In most cases you can simply setup one pihole and copy the gravity.db file to sync your adlist config etc. Some people use the teleporter function.

If you want to sync the gravity db, it's also probably best to clear the gravity table and vacuum before syncing as it keeps the file size down, then run a gravity update to repopulate.

I have also made a script that allows you to extract certain things, edit and reupload them in the old fashion - It just doesn't accommodate for the tweaking of the new DB fields (i.e group management etc)

There are ways to achieve what you are looking for, but not automatically unless you are handy with scripting

On import/refresh (pihole -g) a new database is build and vacuum is obsolete now.

The -o did not work since database version 12 and after fixing that it was remove completely and will not be in the next version of Pi-hole anymore.

Fyi: Gravity Sync will preserve per-client and local DNS rules.