Which files to keep for a complete do-over?

Greetings,

I need advice on what files to keep/copy for a new raspi install. To basically clone it for the new install. please read the background below.

Background: I am running Debian 10 Buster on my raspi but i needed to upgrade it to continue to update pihole. It has been working flawlessly otherwise. I followed this guide and the install was going fine, then it stopped 73% of the way into it and then lost connection to it through my ssh. I was forced to try and reboot the pi and it now cant even boot into recovery mode. However, i can still access the data by plugging in the SD card, so in case nobody on the rasperry pi forums can help me fix my install, I would like to know what files I should copy to use for the worse case of swiping the card and starting from scratch.

Expected Behaviour:

Update Pi from Buster to Bullseye seamlessly.

Actual Behaviour:

stopped updating for unknown reason during upgrade process, cannot boot, therefore cannot access pihole to update pihole

Debug Token:N/A, unable to run rasperri pi.

I did read this post however I wanted to ask again before i go digging and then risk missing a file I should have copied over in case i need to start over from scratch.
Thank you.

As far as Pi-hole is concerned:
Ideally, you'd have created a backup of your Pi-hole configuration via Settings | Teleporter and stashed that away in a safe place where you could just have pulled it out from now.

But as you are asking here, that may not have happened.

In that case, see e.g. Cloning Pi-hole setup and db's? - #5 by Bucking_Horn.

And consider creating a teleporter backup once your Pi-hole is running again. :wink:

1 Like

Yeah, i dont think I set up a teleporter. If i did i sure cant access it on the card! And i dont have anything but the original SD card from which i copied to this new one a while ago. I'm gonna give this a try first before doing anything else. Thanks! I'll update hopefully with good news.

I have a shell script backing up my pihole, it copies/ZIPs the following files:
under /etc/pihole folder, all the *.list *.conf *.leases files
under /etc/dnsmasq.d/ folder, all the *.conf files (I have custom config files for DHCP options, Plex server, EDNS and ECS)
under /etc/lighttpd/ folder, all the *.conf files
I also obtain the exact whitelist, exact blacklist, regex whitelist and regex blacklist .txt files respectively by the command line:
pihole-FTL sqlite3 /etc/pihole/gravity.db "SELECT domain FROM domainlist WHERE enabled = 1 AND type = z;" > GIVE_A_NAME.txt where z is 0,1,2 and 3 respectively. You should give different names to those 4 text files created
And the official pihole teleporter file by the command pihole -a -t
I hope if/when I have a new installation, copying these files to its places should revive the same config (v6 will not use .conf files as far as I know, this approach should work for v5)

1 Like

Over on a RPi flight tracking forum this subject of backing up the running SD card came up. Someone mentioned the RonR Utilities, which can be used to make a .img backup of the running system in situ.

I've not yet tried them but they look interesting as another backup angle. Pi-hole has Teleporter and you've identified various directories and data sources that can be backed up, but perhaps if these utilities work it gives another ready-to-write image of the working system.

https://github.com/seamusdemora/RonR-RPi-image-utils

1 Like

That's not necessary, as all of those are part of the teleporter backup already.

The main thing that won't carry over in teleporter is Pi-hole's query database, which can be quite large. So the one advantage of copying all of /etc/pihole is that you'd keep your query history (see also my linked post above).

That probably won't help in RaspiRescue's case, as their system is already corrupted, incapable of starting and thus of installing new software (and creating an image of that system may just produce another corrupted system).

Indeed, I was jumping ahead to once their system is back up and running, building on the list from korhant, as a way to be prepped for any future SD card issues!

1 Like

Howdy!

I finally got it up an running. I did the old restart after the install and copy pasting the folders and then now i cant open the admin page in a browser on the machine or anything i connect to it. I'm trying to diagnose that. The lighttpd.service daemon is not running for some reason. Though it seems that pihole is running fine otherwise. The pihole debug says pi-hole processes [x] lighttpd daemon is failed but pihole-FTL daemon is active. Lots of into in the debug log to go through and i dont think much of it is gonna help me with this isuue.

I also am having trouble conforming that the static IP i wanted (in this case 192.168.2.200) is actualy the static IP. When i do hostname -i it does not have that IP. edit: it seems that it is indeed static. fastfetch confirms it for me (rip neofetch)

As an aside, is there any way to just open a folder as root/super user mode without having to open the folder in the terminal and type sudo pcmanfm every time? Its annoying when im trying to move things around to troubleshoot. Mint has a feature in the file browser that i can do an open as root function, is there something similar available?

As you've succeeded in getting a new system up and running, please open a new topic describing your current issue with Pi-hole, so we can mark this one as solved.

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