How can I delete the users database to a reset/refreshed state? #179

Closed
opened 2025-11-11 14:10:02 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @oliverbob on GitHub (Jan 13, 2024).

How can I reset the database record if I want to pull new changes and restart from scratch? The UI always tells me that the user exists (but I could not remember my admin password). How can I delete the old entries from which file?

Thanks.

Originally created by @oliverbob on GitHub (Jan 13, 2024). How can I reset the database record if I want to pull new changes and restart from scratch? The UI always tells me that the user exists (but I could not remember my admin password). How can I delete the old entries from which file? Thanks.
Author
Owner

@justinh-rahb commented on GitHub (Jan 14, 2024):

To reset the user database you can delete the /app/backend/data/ollama.db file of the container, wherever you have the data directory mounted on the host. If you have not mounted that directory or created a persistent volume for it, your ollama.db is reset each time you repull the container image.

@justinh-rahb commented on GitHub (Jan 14, 2024): To reset the user database you can delete the /app/backend/data/ollama.db file of the container, wherever you have the data directory mounted on the host. If you have not mounted that directory or created a persistent volume for it, your ollama.db is reset each time you repull the container image.
Author
Owner

@oliverbob commented on GitHub (Jan 14, 2024):

There are already users in this table. I guess this too needs documentation from the docs team out there. How do we change the password of a user? I don't see any password field in the table structure:

SELECT name FROM sqlite_master WHERE type='table';

chat
user
auth
modelfile
prompt
document
sqlite>

PRAGMA table_info(user);

0|id|VARCHAR(255)|1||0
1|name|VARCHAR(255)|1||0
2|email|VARCHAR(255)|1||0
3|role|VARCHAR(255)|1||0
4|profile_image_url|VARCHAR(255)|1||0
5|timestamp|DATE|1||0

My scenario is that on proxmox, I was migrating from one machine to another. I never put into account that /var/lib/docker/volumes/ollama-webui/_data/ollama.db is not part of the cluster or the virtual environment in pve, so that I only did rsync.

I believe we should have a migration docs because man, this repo is improving at lightning speed!

And it should include migrating the volume too.

Another question I have is the structure of the table. The user table doesn't seem to have a password. Accessing the sqlite db should also be documented. This not only makes the system much more user-friendly to devs, but also leave plenty of room for customization and improvement for wishlist and experimentation for a probable PR.

@oliverbob commented on GitHub (Jan 14, 2024): There are already users in this table. I guess this too needs documentation from the docs team out there. How do we change the password of a user? I don't see any password field in the table structure: ``` SELECT name FROM sqlite_master WHERE type='table'; chat user auth modelfile prompt document sqlite> PRAGMA table_info(user); 0|id|VARCHAR(255)|1||0 1|name|VARCHAR(255)|1||0 2|email|VARCHAR(255)|1||0 3|role|VARCHAR(255)|1||0 4|profile_image_url|VARCHAR(255)|1||0 5|timestamp|DATE|1||0 ``` My scenario is that on proxmox, I was migrating from one machine to another. I never put into account that /var/lib/docker/volumes/ollama-webui/_data/ollama.db is not part of the cluster or the virtual environment in pve, so that I only did rsync. I believe we should have a migration docs because man, this repo is improving at lightning speed! And it should include migrating the volume too. Another question I have is the structure of the table. The user table doesn't seem to have a password. Accessing the sqlite db should also be documented. This not only makes the system much more user-friendly to devs, but also leave plenty of room for customization and improvement for wishlist and experimentation for a probable PR.
Author
Owner

@justinh-rahb commented on GitHub (Jan 14, 2024):

Perhaps a command that could be run on the container shell to reset the first admin account password as well? Deleting the whole database isn't exactly an ideal solution to a lost password if you've got other users, and chat histories you'd like to keep.

@justinh-rahb commented on GitHub (Jan 14, 2024): Perhaps a command that could be run on the container shell to reset the first admin account password as well? Deleting the whole database isn't exactly an ideal solution to a lost password if you've got other users, and chat histories you'd like to keep.
Author
Owner

@tjbck commented on GitHub (Jan 14, 2024):

I believe we should have a migration docs because man, this repo is improving at lightning speed!

FYI, the db does not need any migration, and will continue to work after you pull the latest image.

@tjbck commented on GitHub (Jan 14, 2024): > I believe we should have a migration docs because man, this repo is improving at lightning speed! FYI, the db does not need any migration, and will continue to work after you pull the latest image.
Author
Owner

@tjbck commented on GitHub (Jan 14, 2024):

If you'd like to start from scratch, you could always just delete the ollama.db file and you'll be able to create a new admin account. As for the password update, you can do so from the admin panel page but I presume you don't have access to it at the moment.

@tjbck commented on GitHub (Jan 14, 2024): If you'd like to start from scratch, you could always just delete the ollama.db file and you'll be able to create a new admin account. As for the password update, you can do so from the admin panel page but I presume you don't have access to it at the moment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#179