Unable to restart n8n / Digital Ocean

Hello, this is the second time this has happened to me, but my n8n on my Digital Ocean server no longer works. I don’t have much hope of restarting my application correctly but I would have liked to recover my worflow but I have the impression that there isn’t any. Could someone tell me where to find it so that I can recover as much as possible?

Here’s a screen of my server’s file tree

Hi,

You should have a file called database.sqlite somewhere as long as you mapped /home/node/.n8n in Docker, e.g. - ./n8n_home:/home/node/.n8n. If you didn’t do this, then I think you will lose all the configuration including workflows every time you restart your server or Docker.

Also, you should provide the output of docker-compose logs (run it in the same folder where docker-compose.yml file is located).

–Andrew.

1 Like


Thanks for finding the file, I’ll try to extract the data.

1 Like

@driib via database.sqlite are all workflows recorded? I see that the file is 2gb and I have a thing on my mac that reads the structure.
Otherwise thank you again, it helps me a lot :slight_smile:

I think you can just restart n8n server (at the same version you had it running before, ideally), maybe you need to get a server with more RAM if you have such a big database. My database is just below 10MB.

You can try these to see what’s inside your DB:

$ sqlite3 database.sqlite
sqlite> .mode line
sqlite> select name, nodes, connections from workflow_entity limit 3;

This will show nodes and their connections (for 3 workflows). That’s the structure of a workflow as I understand it:

{
  "meta": {
    "instanceId": "xyz"
  },
  "nodes":  %nodes%,
  "connections": %connections%
}

But I think it will be better for you just to get the docker container running again. See VACUUM does nothing for the file size of database.sqlite? - #10 by krynble as well. But more importantly, look at the logs.

3 Likes

Yes, I’ve restarted the server and it’s working again. Last time it didn’t work and deleted some files. That’s why I exported the different folders. Thanks for your help. @driib :100: :+1:

3 Likes