Self hosted server shutdown and lost everything

Hi, i have a big problem. A self hosted server shutdown and lost the workflows and credentials. I didnt configured the server so i dont know anything about the configuration. The only thing i know is that is hosted in a docker container in digital ocean. If somebody can tell me how i can see the configuration so i can share it. When i go to the n8n domain the only thing i can do is create a new user. In the digital ocean terminal i could access the n8n container and i can see a sqlite database but i dont know if in there are my workflows or not and dont know how to restore them.

I am very new to this, am sorry if something doesnt make any sense

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It does make sense. Same sort of thing happened to me early on.

There may be hope if the n8n container was set up such that it uses storage outside the container (i.e. mapped volumes) for application and database files. If so, try and get a copy of the n8n config file (which may have the encryption key value), and all of the contents of the “db” or “database” volume.

If the instance was set up according to these instructions, which make use of these setup files, the volume mappings in the docker-compose.yml file might give you some insight into where to find the data.

If the container was rebuilt, and the db and/or app storage was/were not mapped to external volumes, all of that data might have been written into the volatile storage (memory) in the running container, and would be discarded when the container is rebuilt.

I hope you are (or were) able to get the data back. If not, be sure you get things reconfigured to use storage volumes outside the container going forward.

Hey @FeliPampin ,

Since your n8n instance is running in Docker on DigitalOcean, and you see a SQLite database, your workflows and credentials may still be recoverable. Here’s what you can do:


:small_blue_diamond: Steps to Recover Workflows & Credentials

:one: Check If the SQLite Database Still Contains Your Data

  • Run the following inside the n8n container to see if your database file exists:
docker exec -it n8n ls /home/node/.n8n
  • If you see a file named database.sqlite, your data is likely intact.

:two: View the Workflows Stored in SQLite

  • To check if your workflows still exist, run:
docker exec -it n8n sqlite3 /home/node/.n8n/database.sqlite
  • Then, run this SQLite command:
SELECT id, name FROM workflow_entity;
  • If you see a list of workflows, they are still in the database.

:three: Backup the Database Before Any Changes

  • Before proceeding, make a backup of your database:
docker cp n8n:/home/node/.n8n/database.sqlite .
  • This copies the database file to your local machine, so you have a backup.

:four: Restart the n8n Container & Check Logs

  • Restart the n8n container and check for errors:
docker restart n8n
docker logs -f n8n
  • If the logs show issues with credentials or workflows missing, your database may be corrupted or not loading correctly.

:five: Restore Workflows Manually (If Needed)

  • If you can access the database but workflows don’t appear in the UI, you might need to export them manually:
docker exec -it n8n sqlite3 /home/node/.n8n/database.sqlite ".dump workflow_entity" > workflows_backup.sql
  • You can then manually re-import them into a new n8n instance.

:six: Check If Data Was Stored in a Volume (Not Inside the Container)

  • Run:
docker inspect n8n | grep Mounts -A 10
  • If your data was stored in a Docker volume, it might still be available.
1 Like

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