Planning PiHole server migration... can I migrate long-term data?

Greetings all. I am going to perform a server migration and move my PiHole instance from my current 4th Gen Intel Nuc to a brand-new 13th Gen NUC.

It's to my understanding standard operating procedure is to to perform a fresh install of PiHole on the new hardware & apply a Teleporter backup from the legacy system.

However, I am wondering if there's any chance I can retain the long-term query data and apply it to the new installation? I like being able to check out at the graphs every now and then to identify trends (E.G when I migrated my main Windows workstation to Linux there is a CLEAR drop-off of blocked queries from that day forward).

If it is possible to retain the long-term data, please let me know how feasible it would be & the process & steps needed to accomplish this.

Thanks in advance for any support!

Pi-hole's long-term query database is stored at /etc/pihole/pihole-FTL.db.

You could just stop your old Pi-hole process and copy that file over to your new Pi-hole (which has also to be stopped).

Or you could create a clean copy of the existing database to a new file with the following command:

pihole-FTL sqlite3 /etc/pihole/pihole-FTL.db "VACUUM INTO '/path/to/pihole-FTL.backup.db'"

Replace /path/to/ with an existing location as required (e.g. with a network mount).
This results in a potentially smaller file than the direct copy, and it can be executed while your old Pi-hole is running.

You'd then copy that pihole-FTL.backup.db to /etc/pihole/pihole-FTL.db in your new Pi-hole's installation. The new Pi-hole should be stopped for the copy/move, and only be restarted once that has completed.

2 Likes

Glad to hear it's possible to retain & transfer the Pi-Hole database across instances. Even better to see both an offline & online solution.

That being said, I am going to take the legacy pihole-FTL.db and overwrite the new pihole-FTL.db on the new system. Seems to be the simplest path for my needs for the time being.

The new system should be installed in my homelab within the next few days, so in theory I'll be able to report back with my findings (if any) prior to the thread's autoclosure.

Thanks again for your support & advice on this matter!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.