I run self-hosted n8n on Railway (Docker, SQLite on a persistent volume mounted at /home/node/.n8n). I previously logged in via GitHub. After what appears to have been a version upgrade during a redeploy, my instance now shows an email/password login instead, and I ended up on a new, empty owner account . My three existing workflows no longer appear. “Forgot my password” returns “n8n isn’t set up to send email right now” because I never configured SMTP. The Railway volume is intact and online (data still on disk). How do I recover access to the original owner account / make my existing workflows visible again without losing them? I have no database backup, so I want to proceed safely.
Hey @dpetretta, while you wait for a response, here are some things that might help:
Suggested resources
Automatically matched to your question.
Docs:
Forum:
@gusgvd, @mechanizedgrowth, @bridgewaretech - you’ve helped with similar issues before, can you take a look?
Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.
did you setup a yubico key? or second factor (not sms texting)?
this is post-recovery advice:
tOTP is simple and does not require silly phone apps. Bookmark a web tOTP. Or have your token tOTP
If yubico it out of budget then DIY token
100% —NOT— for banking.
Hey @dpetretta Welcome in, Can you open a shell in the running n8n service with railway ssh and run n8n list:workflow?
Does it list the three missing workflows? Please share n8n --version too. That checks the database this deployment is actually using before changing any accounts.
Before changing any account, confirm which database file the running deployment actually opened. An empty owner account plus missing workflows almost always means n8n started against a different SQLite file than before, not that the data is gone.
- Look inside the volume:
ls -la /home/node/.n8nand find the.sqlite/.dbfile. An old mtime and a non-trivial size means that is your original database. - Read it without changing anything:
sqlite3 <file> "select id,email,role from user;"and"select count(*) from workflow_entity;". If your old user row and the three workflows are still there, the data is intact and the problem is the path - the Railway volume not mounted where n8n looks, orDB_SQLITE_PATH/N8N_USER_FOLDERchanging during the redeploy. - n8n prints the database it connects to in the first lines at boot; that line tells you which file actually won.
Then fix the mount or the env var and restart, rather than onboarding again. Do not run n8n user-management:reset and do not create another owner account meanwhile: that writes a new owner into whichever file is currently open, and that copy is the one you would then be stuck with. n8n list:workflow is a good probe, but run it in the same shell context as the service so it reads the same database.
The safest first step is to verify which database the running instance is actually using before changing the owner account.
A missing workflow in the UI does not necessarily mean the workflow data has been deleted. Checking the active database path and confirming the records exist can help avoid unnecessary changes or data loss.
In my n8n + FastAPI + PostgreSQL demo, I’ve tested database-failure responses and recovery. This is a good reminder that recovery should begin with verification and a backup, not with changing account state.
Hi @dpetretta, first open your n8n service’s Backups tab in Railway and create a manual backup of the volume mounted at /home/node/.n8n. Keep any custom N8N_ENCRYPTION_KEY securely alongside the backup.
One correction to the path advice: the SQLite filename setting is DB_SQLITE_DATABASE, not DB_SQLITE_PATH. A file’s age or size doesn’t establish that it’s the original database.
If the CLI lists your three workflows from the same database the running service uses, those workflow records are present. Their user/project associations need checking before changing database paths or resetting accounts. The version requested above will help determine the correct recovery steps.
Hi Davide! Urška from n8n Support here.
If I may, one thing worth saying before you run it: if n8n put you on the owner setup screen (name, email, new password) instead of a login screen, the database it booted against has no set-up owner in it. An upgrade by itself doesn’t do that to an existing SQLite file. The two usual causes are the volume not being mounted at /home/node/.n8n on the new deployment, or environment variables going missing on the redeploy (DB_TYPE, DB_SQLITE_DATABASE, N8N_USER_FOLDER, anything SSO-related if that’s what “logged in via GitHub” was). Either way n8n starts a fresh database, which is also why your workflows look gone. They’re very likely still in the old file.
As Deepankar and Anshul said, confirm what the running instance is reading first. In a Railway shell, ls -la /home/node/.n8n should show database.sqlite and config (the config file holds your encryption key if you didn’t set N8N_ENCRYPTION_KEY; keep it with the database).
Then n8n list:workflow tells you whether the three workflows are in the database that this deployment actually uses. Compare the env vars on the new deployment with what you had before.
Once the CLI lists your workflows, the supported way back in without SMTP is n8n user-management:reset. I checked the source before recommending it: it keeps every workflow and credential, reassigns them to the owner’s personal project, removes any other user accounts, and clears the owner’s email and password so the setup screen shows again. You then set a new owner email and password and everything is where you left it. It won’t help if it runs against the empty database, which is why the check comes first.
If the folder is empty or list:workflow shows nothing, the data is on a different volume or path, and that’s a Railway question rather than an n8n one. Take a volume backup before you change anything either way.
Copy the whole volume first. Then look at the size of database.sqlite in /home/node/.n8n, if it’s tiny the redeploy probably made a fresh one and your old data is somewhere else on the volume.
Don’t change anything on the volume yet. Copy database.sqlite off it first so you have a backup. Then check the new deploy is actually reading that file, because a changed mount path would create a fresh empty database. If the old file is intact, you can point n8n back at it and sort out the login from there.