mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #4265] [QUESTION] Postgres migration #2750
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2750
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dasunsrule32 on GitHub (Dec 29, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4265
Hello, I see that Postgress support was added with https://github.com/NginxProxyManager/nginx-proxy-manager/pull/4254. I am wondering if there is a migration path from the default
sqlitetopostgres? Thanks. :)@dasunsrule32 commented on GitHub (Dec 29, 2024):
I tried a straight
pgloadermove and it failed.Only failure is:
Following errors in NPM:
If I leave the
postgresqldatabase empty, it creates the tables. At this point, it doesn't look like there is a migration for now as it seems NPM doesn't try to use the exiting tables if they exit, only create new ones.I don't feel like recreating everything from scratch, so I guess I'll be waiting as I don't know enough about database migrations to be of much help.
@dasunsrule32 commented on GitHub (Dec 30, 2024):
Ok, fiddled with it a bit more and got it working with
pgloader. The only thing I had to do was re-create my admin user, but all other data is there and it's working correctly from what I can tell.Configure NPM to use
postgresthen start it, let it create the tables. Stop NPM, then load thesqlitedatabase intopostgres.Create a file called
npm.loadwith the following content. Update the information needed. Download thedatabase.sqlitefrom your server and run it in the same directory as thenpm.loadfile.Then run:
pgloader -vvv npm.loadYou'll get similar output to below when completed:
NPM Log output showing the
postgresas the database server:@dasunsrule32 commented on GitHub (Dec 30, 2024):
Just leaving it open for others to see and check out if there are any issues with this migration. I kept my sqlite db in case... Make sure to keep our sqlite database around in case...
@reply2future commented on GitHub (Jan 6, 2025):
Thank you for your migration solution, it helps me a lot!
But I added a clear data steps to prevent input data error because of duplicate primary key, so I don't have to re-create the account or change the password of the default user.
And then I import the data by running
pgloader -vvv npm.load. Everything works as before.@dasunsrule32 commented on GitHub (Jan 9, 2025):
This is great! Thanks. :)
@github-actions[bot] commented on GitHub (Jul 25, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍