# HELP to restore my database (users, points, settings)

**URL:** https://discourse.dawarich.app/t/help-to-restore-my-database-users-points-settings/248
**Category:** Dev and Self-hosting
**Tags:** selfhosting
**Created:** [November 2, 2026, 7:22am UTC](https://discourse.dawarich.app/t/help-to-restore-my-database-users-points-settings/248 "2026-11-02T07:22:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jpb](https://discourse.dawarich.app/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@jpb](https://discourse.dawarich.app/u/jpb)
#### Post date: [November 2, 2026, 7:22am UTC](https://discourse.dawarich.app/t/help-to-restore-my-database-users-points-settings/248/1 "2026-11-02T07:22:15Z")

</div>

Hi,

I was until today on version 1.18.1 and today I updated to 1.20.1 .

I don’t know what happened but after restarting the Docker stack with the updated compose file I had lost my user.

So I tried restoring my DB – I had to first truncate the ‘users’ table otherwise I could not restore, probably because of the way I had created my dump – but each time I started the stack my user in the db would be wiped out and the only user left in the db would be the demo user… 🤨

I also tried to go back to the image of version 1.18.1. With that image and a db restore, I was able to log in, so my user survived the db start, yet all my other data (points, settings) was still gone.

Could someone help me restore my system?  
Thank you very much in advance.

How my dump was created:  
pg\_dump -U postgres dawarich\_development | gzip \> dawarich-db\_dump.sql.gz

---

<div class="post-metadata">

### Author: ![jpb](https://discourse.dawarich.app/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@jpb](https://discourse.dawarich.app/u/jpb)
#### Post date: [November 2, 2026, 10:01pm UTC](https://discourse.dawarich.app/t/help-to-restore-my-database-users-points-settings/248/2 "2026-11-02T22:01:59Z")

</div>

I think a found a solution.

while still on rolled back 1.18.1 image, I not only ‘truncated’ the ‘users’ table but I had to delete all the db’s tables. Only then was I able to do a proper restoring.

These are the commands I used to delete everything in the dawarich\_development db:

First: `docker compose exec -i dawarich_db psql -U postgres dawarich_development`

Then:

> DROP SCHEMA public CASCADE;  
> CREATE SCHEMA public;  
> GRANT ALL ON SCHEMA public TO postgres;  
> GRANT ALL ON SCHEMA public TO public;  
> COMMENT ON SCHEMA public IS ‘standard public schema’;  
> CREATE EXTENSION postgis;

After that, I changed again the image for 1.20.1 and then it worked.

So, maybe all this was because when I first updated to 1.18.1 I was still using the separate sidekick container and that it did not upgrade properly.

---

<div class="post-metadata">

### Author: ![noahjackson](https://discourse.dawarich.app/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@noahjackson](https://discourse.dawarich.app/u/noahjackson)
#### Post date: [November 23, 2026, 8:12pm UTC](https://discourse.dawarich.app/t/help-to-restore-my-database-users-points-settings/248/3 "2026-11-23T20:12:05Z")

</div>

Glad you got it back. Worth noting for next time: a plain pg\_dump without --clean is meant to be restored into an empty database, since every CREATE TABLE and COPY will collide with existing objects — that’s likely why truncating just users wasn’t enough. So the drop-schema step was the right move, not a workaround. Your guess about the old sidekiq container also sounds plausible; if migrations or seed tasks ran against the half-restored schema, they could have recreated the demo user each boot. Cleanest routine: stop the app, restore into an empty DB, then start the new image so migrations run once afterwards.
