No pre-existing workflows shown when upgraded from 0.207.1 to 0.222.3

Describe the problem/error/question

Hi I have upgraded n8n using ubuntu Docker server from 0.207.1 to 0.222.3 in one step. All went fine though when starting the container again the output shows:
Last session crashed
Migrations in progress, please do NOT stop the process.
Initializing n8n process
Migrations finished.
n8n ready on 0.0.0.0, port 5678
Version: 0.222.3

The problem is that no pre-existing workflow is shown any more.
I spent a lot of time creating this workflow, so i worry about getting them back

What is the error message (if any)?

there are no active workflows

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

note: Before I started with the upgrade i made a backup of /home/ubuntu/.n8n

this is the procedure that I followed:
##############

created backup

[email protected]:~$ tar -cvf 20230421-n8n-node02-backup /home/ubuntu/.n8n/
tar: Removing leading `/’ from member names
/home/ubuntu/.n8n/
/home/ubuntu/.n8n/config
/home/ubuntu/.n8n/crash.journal
/home/ubuntu/.n8n/binaryData/
/home/ubuntu/.n8n/binaryData/meta/
/home/ubuntu/.n8n/binaryData/persistMeta/
/home/ubuntu/.n8n/database.sqlite

performed query in docker

sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
619c999f392a n8nio/n8n “tini – /docker-ent…” 7 weeks ago Up 7 weeks 0.0.0.0:5678->5678/tcp, :::5678->5678/tcp n8n

stopped running container

[email protected]:~$ sudo docker stop 619c999f392a
619c999f392a

verify running containers

[email protected]:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

downloaded new docker image

[email protected]:~$ sudo docker pull n8nio/n8n
Using default tag: latest
latest: Pulling from n8nio/n8n
63b65145d645: Pull complete
a67f65df360b: Pull complete
6112f742730b: Pull complete
4d4a28bae26a: Pull complete
4f4fb700ef54: Pull complete
dd5a8247dfd8: Pull complete
5baefc557521: Pull complete
b9572d22ad63: Pull complete
44c07a8a304a: Pull complete
f1e7aa6b300e: Pull complete
87f17fd7c709: Pull complete
Digest: sha256:3ec353a93b512f6ca9c1b4203e13593dafe866b677ab6f446e6707decef52a36
Status: Downloaded newer image for n8nio/n8n:latest
docker.io/n8nio/n8n:latest

restarted n8n

sudo docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n
Last session crashed
Migrations in progress, please do NOT stop the process.
Initializing n8n process
Migrations finished.
n8n ready on 0.0.0.0, port 5678
Version: 0.222.3

Editor is now accessible via:
http://localhost:5678/

Press “o” to open in Browser.

checked in via webbrowser, all workflows gone!

##############

Please help getting back my workflows
regards
Stefan

Hi Stefan, I am sorry you are having trouble. Based on the information provided I am not sure what exactly has happened in your case I am afraid. Running n8nio/n8n:0.207.1 via docker, saving a workflow, then upgrading to 0.222.3 did not remove the workflow for me.

Do your workflows still exist in the workflow_entity table of your database? Or has your database been cleared for some reason as part of the upgrade?

Seeing you have taken a backup you could consider extracting it to a new location, spin up your old n8n instance and then use the CLI commands to export your workflows from the old instance. You should then be able to import these in your current instance.

Hi Tom, thanks for getting back.
The problem was that I (re)started Docker n8n container using
sudo docker run -it --rm --name n8n …

The started n8n node tried to resolve ~/.n8n into /home/ubuntu/.n8n (ubuntu is sudo user)

But when i initiated n8n node using
docker run -it --rm --name n8n under root account, it did find the correct workflows because it resolved into /root/.n8n

The workflows appeared again, luckily.

I wasn’t aware that performing the action under root account would resolve the target dir into another dir then using sudo user account.

What should be the correct way ?

regards
Stefan

2 Likes

Glad to hear this worked out for you!

I guess a simple way of avoiding this could be to use absolute paths. So something like sudo docker run -it --rm --name n8n -p 5678:5678 -v /your/full/path/to/.n8n:/home/node/.n8n n8nio/n8n would always point to /your/full/path/to/.n8n, regardless of who runs the command.

Personally, I use docker compose and would specify my volumes using something like ./data:/home/node/.n8n, so a data folder inside the current directory specified with the single dot .

1 Like

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