Skip to content

Engaging

Michael Stanclift edited this page Apr 13, 2022 · 6 revisions

Before you Engage in your first sync, make sure that you have installed and configured Gravity Sync on both of your Pi-hole.

Dry Run

Run a comparison between remote and local databases, which will be non-disruptive, and see if everything has been configured correctly. Do this from both Pi-hole.

gravity-sync compare

Assuming Gravity Sync runs successfully, it will indicate if there are changes pending between the two databases.

First Sync

You must now pick the Pi-hole instance that currently has the "authoritative" list of settings and run the following command to send all of those settings to its peer for the first time. Do this only from the authoritative Pi-hole.

gravity-sync push

If you do not follow this step, especially if one of your Pi-hole instances is a fresh install, you run the risk of overwriting your current configuration with a default setup or something else less desirable.

Standard Orbit

The default command for Gravity Sync is simple.

gravity-sync

Gravity Sync will perform some checks to help ensure success and then stop before making changes if it detects an issue. It will also perform the same compare function outlined above, and if there are no changes pending, it will exit without making an attempt to copy data.

Example: If the gravity.db has been modified on the remote Pi-hole, but the custom.list file has been changed on the local, Gravity Sync will now do a pull of the gravity.db then push custom.list and finally restart the correct components on each server. It will also only perform a sync of each component if there are changes within each type to replicate. So if you only make a small change to your Local DNS settings, it doesn't kickoff the larger gravity.db replication.

In the event there are configuration changes to the same element (example, custom.list changes at both sides) then Gravity Sync will attempt to determine based on timestamps on what side the last changed happened, in which case the latest changes will be considered authoritative and overwrite the other side. Gravity Sync does not merge the contents of the files.

If the execution completes, you will now have a synchronized copy of your running gravity.db, custom.list and 05-pihole-custom-cname.conf on both Pi-hole.

More on Push vs Pull