Gravity Sync, an easy way to keep multiple Pi-hole In-sync

Hi @papasan,

If you review the GitHub repo, you'll see that there has been a lot of features added since this initial posting was made, including the sync of Local DNS Settings. Clients/groups for v5 Pihole get stored in gravity.db which is replicated. Upstream DNS, is specifically called out as not replicated, but should be possible -- although I've had to take a little break from features for a bit. It doesn't seem as if that would change very often as to require automated replication.

hmm, fresh pihole install, fresh gravity-sync install, initial sync didn't pull anything over but the blocked domains. my white/black list, local DNS, groups, clients, etc are all empty. I will poke around and see if I can figure out why. thanks!

edit found the issue, problem was between chair and keyboard. working wonderfully, thanks for this!

I just published a significant update to Gravity Sync yesterday, version 3.1. Among the major changes are support for Docker installs of Pi-hole. This has been a common request since I first released the script shortly after the release of Pi-hole 5.0. Some folks were able to hack the script to make it work, but I've gone through and reworked a lot of the logic to make it a core feature. (The caveat here is that only the official Pi-hole managed Docker image is supported.)

However, you can now use a "standard" Pi-hole install as your primary, or your secondary. You can use a Docker install of Pi-hole as your primary, or your secondary. You can mix and match between the two however you choose. You can have Pi-hole installed in different directories at each side, either as standard installs or with container configuration files in different locations. Overall it's much more flexible.

This release also changes a lot of things about the requirements that Gravity Sync has always had, which were not running as the root user, and requiring that the script be run from the user's home directory. Those two restrictions are also gone.

If you've previously deployed and it's working, great, please update. It should keep working just like it did, or maybe a lot better depending on the version you have now. ( ./gravity-sync.sh update ) If you've looked at this solution before and it didn't fit your needs, I'd encourage you to take another look and see if it does now. There is also a new installer, which should help make what was already a pretty easy deployment, even easier.

(Please see the full 3.1 Changelog for more details.)

I'd also like to thank everyone who has provided feedback, filed issues in GitHub, and contributed code of their own to the project. I'm humbled anytime someone Likes the repo, or says this solved a problem for them. :pray:

3 Likes

Please open an issue on the Github page for Gravity Sync.

1 Like

@markladage see 'Folder gravity-sync already exists' when running installer · Issue #111 · vmstan/gravity-sync · GitHub

If I have 2 pi-holes with gravity-sync, can I update the secondary to 5.3.x as a test, and then update the primary a week later ?

You'll have to ask the author of gravity-sync.

1 Like

I'm am actually just testing this now. There is a thread over on my GitHub if you run into any issues.

Thanks. I shall read and decide tomorrow.

How did you get on?

@vmstan

Great tool. Works like a charm.
Thank you. :+1:

I have been following the guide here: https://youtu.be/IFVYe3riDRA

I have made it to the point of running "export GS_INSTALL=secondary && curl-sSL https://gravity.vmstan.com | bash" as root (sudo su) on the secondary pihole dns server.

The only error is the one show in the topic:
[x] Folder gravity-sync already exists
[!] Use ./gravity-sync.sh update to Update Instead
[*] 1 Critical Issue detected
[!] Please correct failures and re-execute

while within the gravity-sync folder on the secondary pihole I ran "./gravity-sync.sh update. Below is the output of such. It did not fix the issue. The above still occurs upon running.

[∞] Gravity Sync 3.3.2 Executing
[✓] Evaluating Arguments: UPDATE Requested
[✓] Updating Cache
[✓] Applying Update
[∞] Gravity Sync UPDATE Completed (1 seconds)

"I might be old and slow, but I'm not stupid!"

How do I fix it Dan? I am pretty new to a lot of this. I have been reading for hours on trying to fix it.

Use the link, he specifically states to:

The installer is intended for new Gravity Sync instances only. It uses git clone to create the Gravity Sync folder, which will not work if there is an existing git installation there.

Please feel free to comment below on this if you have any questions, even though the issue is closed.

Just found it, and it certainly serves a need. Thank you.
One thing, however.
Why cronie? In the documentation your mention it in the apt install stanza, so I was going to figure out how to install it on debian buster, but just cron works fine. And cron is so common, I really have no idea what type I'm running.
ta,

René

Let me try to help you. I'm making assumptions but here we go.
I'm guessing that that gravity-sync folder is left over from an aborted install, so there may be some files in there, but no relevant configuration.
What I've gathered so far, you can do one of to things.
1 Delete the damn gravity-sync folder (rm -rf gravity-sync) and rerun the installation.
2 Go into that folder and run the setup. Move into the folder and run ./gravity-sync config
If your install was broken off I cannot check if all the files are here and correct. Frankly, I'd take option one.

Closing the thread here - as any questions and support issues are best dealt with on @vmstan 's own repository

1 Like