# Pi-hole database needs to be restored after every reboot

**URL:** https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925
**Category:** General
**Created:** [May 9, 2021, 5:40pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925 "2021-05-09T17:40:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![zXmRQNya8lQc](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/z/8edcca/32.png) [@zXmRQNya8lQc](https://discourse.pi-hole.net/u/zXmRQNya8lQc)
#### Post date: [May 9, 2021, 5:40pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/1 "2021-05-09T17:40:45Z")

</div>

After every reboot of Pi-hole I have to restore the database via `pihole -g -r` because elsewise I'm getting a resolvement error for localhost in the diagnosis output of `pihole -d`.

This is my debug token after the database has been restored:  
[https://tricorder.pi-hole.net/r8cvx2k02j](https://tricorder.pi-hole.net/r8cvx2k02j)

The log is showing database errors - all I remember is having created a database with Postgres.

Does anybody know what to look for?

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 9, 2021, 8:34pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/2 "2021-05-09T20:34:43Z")

</div>

These database errors appear to be from your long term database, not the gravity database. Let's try making new database whole saving the old one if needed.

`sudo service pihole-FTL stop`

`sudo mv /etc/pihole/pihole-FTL.db /etc/pihole/pihole-FTL-old.db`

`sudo service pihole-FTL start`

---

<div class="post-metadata">

### Author: ![zXmRQNya8lQc](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/z/8edcca/32.png) [@zXmRQNya8lQc](https://discourse.pi-hole.net/u/zXmRQNya8lQc)
#### Post date: [May 10, 2021, 4:25pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/4 "2021-05-10T16:25:15Z")

</div>

The files actually were found in `/etc/pihole` and I did what you suggested with the errors having disappeared now.  
[https://tricorder.pi-hole.net/tnf0ulgy0r](https://tricorder.pi-hole.net/tnf0ulgy0r)  
But there's still an error:

```auto
*** [DIAGNOSING]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Accept-Ranges: bytes
ETag: "1251518635"
Last-Modified: Sat, 01 May 2021 17:40:05 GMT
Expires: Mon, 10 May 2021 16:18:19 GMT
Cache-Control: max-age=0
Content-Length: 10701
Date: Mon, 10 May 2021 16:18:19 GMT
Server: lighttpd/1.4.53

```

My latest debug token is at [https://tricorder.pi-hole.net/tnf0ulgy0r](https://tricorder.pi-hole.net/tnf0ulgy0r).

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 10, 2021, 6:55pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/5 "2021-05-10T18:55:32Z")

</div>

> [@zXmRQNya8lQc](#):
>
> The files actually were found in `/etc/pihole` and I did what you suggested with the errors having disappeared now.

My apologies for the error - my typo. I corrected my reply for the benefit of others who read this post in the future.

---

<div class="post-metadata">

### Author: ![zXmRQNya8lQc](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/z/8edcca/32.png) [@zXmRQNya8lQc](https://discourse.pi-hole.net/u/zXmRQNya8lQc)
#### Post date: [May 10, 2021, 6:59pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/6 "2021-05-10T18:59:37Z")

</div>

Should I create a separate thread for the other error?

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 10, 2021, 7:13pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/7 "2021-05-10T19:13:16Z")

</div>

> [@zXmRQNya8lQc](#):
>
> But there's still an error:

Are you using the blockpage? If not then that result is correct.

---

<div class="post-metadata">

### Author: ![zXmRQNya8lQc](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/z/8edcca/32.png) [@zXmRQNya8lQc](https://discourse.pi-hole.net/u/zXmRQNya8lQc)
#### Post date: [May 10, 2021, 7:17pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/8 "2021-05-10T19:17:11Z")

</div>

How do I know if I'm using the blockpage?

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [May 10, 2021, 7:41pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/9 "2021-05-10T19:41:33Z")

</div>

You aren't. Ignore the warning.

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 10, 2021, 7:51pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/10 "2021-05-10T19:51:58Z")

</div>

> [@zXmRQNya8lQc](#):
>
> How do I know if I'm using the blockpage?

Not all the blocking modes provide a block page. You are using NULL (the default) and this does not provide a block page.

> **[Blocking mode - Pi-hole documentation](https://docs.pi-hole.net/ftldns/blockingmode/)**

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [May 17, 2021, 7:52pm UTC](https://discourse.pi-hole.net/t/pi-hole-database-needs-to-be-restored-after-every-reboot/46925/11 "2021-05-17T19:52:21Z")

</div>

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