My Raspbery Pi running Pi-hole is coming up to 5 odd years of use and there are a few odd quirks I get when updating Raspbian Buster. This might be due to the SD card failing and when I try to update the root hints file for unbound nothing happens. It used to show me the details of the name servers on the command line now it just does nothing.
Anyway what I really want to do is teleport all my settings, I have a lot of custom groups for various devices, and put them on a fresh install of Pi-hole with a new SD card.
Will I have to configure unbound before hand and will all my groups come over in full? I've not done this before so I just wanted to check what else I may need to do before a restore.
I have migrated Pi-hole many times. You are correct you need to make sure the new device at the operating system level has that static IP address.
As for software install order I would suggest you next get Pi-hole installed and running with a simple configuration that uses one of the default resolvers and test.
Then install and configure Unbound for DNS lookup using a port as described in the pi-hole documentation. unbound - Pi-hole documentation
Then configure the Pi-hole DNS settings to use the Unbound services. And test again. Once that is done you can import your configuration via Teleport. I have found that everything comes over fine and some of the setting on the Settings/DNS page will need to be validated after the teleport. After that you should be good.
If you are using Pi-hole as a DHCP server you should shut down the ole Pi-hole first or disable the DHCP server in the old unit. Also be aware that you probably will have to swap the IP address of the new unit with the IP address of the old unit once you want to go live to keep the address consistent with devices on your network.
The teleporter process is completely separate from your unbound instance. Your groups and other blocking details (adlists, regex, domain blocks, domain whitelist entries, groups) will be transferred by the Teleporter process.
My recommendation (having just done this in the past two days, updating an Armbian install from Buster to Bookworm):
Backup your Pi-hole settings with Teleporter. Ensure you don't save the export file to your SD card - best place is on the computer you are using to access the web admin GUI.
Back up your unbound settings - file /etc/unbound/unbound.conf.d/pi-hole.conf, also to an external device (not on the Pi).
Get a fresh SD card, 32 GB minimum (more write surface for wear leveling).
Flash the new OS on new card (latest Bullseye).
Set up the static IP on the new card, timezone, locale, language, etc.
Install Pi-hole on the new card and choose one of the public DNS servers on install (Cloudflare, Quad9, etc).
Import your settings with teleporter.
Install unbound, including the root hints file if needed. Then install your saved pi-hole.conf file and restart unbound and test it per our guide.
Configure Pi-hole to use unbound as the upstream DNS.