Transferred entire container including pihole-FTL.db, yet I don't see any history

Hi! I moved my entire PiHole install from one machine to another due to the first one dying. I managed to restore everything in the other machine except the history, as that just shows zero requests before the restore date.

I can see a 1GB pihole-FTL.db, so I know that I have everything. I could even log in with the password from the old install but the old history is completely gone.

Any idea of what it could be and what I could do to restore the old history? Thanks!

Adding screenshots of the before and after restore :slight_smile:

Before restore in tar.gz

After restore, running

You are showing the contents of ~/pihole/data/. Did you set this directory as a bind mount in the container?

What do you see inside the container?

Correct. I followed the docker compose example on Docker Hub.

Edit: I noticed the password, already changed it.

Use docker exec <container_id> ls -la /etc/pihole to make sure the files are the same.

Here :slight_smile:

They appear to be the same.

Please share your docker-compose or docker run script.

Sorry for the late response. Here is my docker-compose.yml:

version: "3"

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
    environment:
      TZ: "America/Santiago"
    volumes:
      - "/home/lemon/pihole/data:/etc/pihole"
      - "/home/lemon/pihole/dnsmasq:/etc/dnsmasq.d"
    restart: unless-stopped

If any extra information is needed, feel free to ask and ill happily provide it :slight_smile:

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Hi, the token URL is https://tricorder.pi-hole.net/wk3btRfV/

Your debug log looks inconspicous.

Did you try to shutdown Pi-hole, remove the container and the create it afresh?

Hi, sorry for the late response.

Yes, I removed the containers and created them again 3 times as a way to diagnose the issue, but that didn't helped with the logs showing back.

How did you conclude that your older data is unavailable?

I just tried to recreate your issue and copied an older database file to my Docker PI-hole's directory and had no difficulties plotting some Long-term Data | Graphics for a period covered by that database.

From what you've shared so far, I can see no reason why it shouldn't work for you.

What is the actual output when you try to plot some month of Long-term Data | Graphics covered by your database?

Statistics and logs were reset, that made me suspicious. Now that the file size not only has stayed the same but even increased since the 18th makes me think that is there, just now showing up.

I just tried that, it just continues loading.

Okay, I deleted the local image, container and Docker network and ran everything again with docker compose up -d and it now shows everything as expected.

The dashboard statistics only cover the most recent 24 hours.
If data from your database would have been older than 24 hours at the time of restoration, the dashboard would indeed have been void of data initially.

Plotting data may take a long time (and even fail due to insufficient memory) if there's a lot of data - so that would suggest there is indeed data retrievable.

What is the output of:

docker exec <container-id> pihole-FTL sqlite3 /etc/pihole/pihole-FTL.db "SELECT count(*), client \
FROM queries WHERE timestamp>=strftime('%s', DATETIME('2023-04-01')) \
AND timestamp<=strftime('%s', DATETIME('2023-05-01'))
GROUP BY client ORDER BY 1 DESC;"

EDIT: I see you're sorted - you may disregard that SELECT. :wink:

Oh, okay. I didn't knew it, sorry about that.

I thought it showed the total amount of requests since installation, as I always saw the "Total queries" going up in the dashboard.

Yeah, I noticed that xd

image

800211|172.19.0.1
213542|192.168.100.2
87906|192.168.100.6
49642|192.168.100.32
43592|192.168.100.39
16095|192.168.100.26
6153|192.168.100.11
5409|127.0.0.1
4602|192.168.100.34
3367|192.168.100.3
1856|192.168.100.36
1103|192.168.100.12
8|172.23.0.1
1|172.23.0.2
1 Like

That output confirms that your query history is available.
Please mark any reply you seem fit as a solution.

It also shows quite a substantial amount of DNS requests for April 2023, the vast majority originating from your Docker's gateway IP.

If that would be an issue for you, please open a new topic.