n8n question reddit / selfhosted ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 18:48 For those that use n8n with docker: followed update procedure for docker install. Now i've lost all of my flows. I followed the official document for docker installation, creating a volume. Is there a way to point the new update to the volume? or was the volume wiped out with the update command: `sudo docker compose pull` ​ ---------------------------------------------------------------------- cloudzhq · 2023-11-10 19:10 Pull just downloads new images. It doesn’t do anything else. You’ll need to down / up for it to use the new images. You didn’t launch them as another user or so? Created as user, updated as root or so? ---------------------------------------------------------------------- hdddanbrown · 2023-11-10 19:23 Share your actual compose file with us. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:37 `version: "3.7"` `services:` `traefik:` `image: "traefik"` `restart: always` `command:` `- "--api=true"` `- "--api.insecure=true"` `- "--providers.docker=true"` `- "--providers.docker.exposedbydefault=false"` `- "--entrypoints.web.address=:80"` `- "--entrypoints.web.http.redirections.entryPoint.to=websecure"` `- "--entrypoints.web.http.redirections.entrypoint.scheme=https"` `- "--entrypoints.websecure.address=:443"` `- "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"` `- "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"` `- "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/a cme.json"` `ports:` `- "3002:80"` `- "6443:443"` `volumes:` `- traefik_data:/letsencrypt` `- /var/run/docker.sock:/var/run/docker.sock:ro` `n8n:` `image: docker.n8n.io/n8nio/n8n` `restart: always` `ports:` `- "127.0.0.1:5678:5678"` `labels:` `- traefik.enable=true` `- traefik.http.routers.n8n.rule=Host(\`${SUBDOMAIN}.${DOMAIN_NAME}\`)` `- traefik.http.routers.n8n.tls=true` `- traefik.http.routers.n8n.entrypoints=web,websecure` `- traefik.http.routers.n8n.tls.certresolver=mytlschallenge` `- traefik.http.middlewares.n8n.headers.SSLRedirect=false` `- traefik.http.middlewares.n8n.headers.STSSeconds=315360000` `- traefik.http.middlewares.n8n.headers.browserXSSFilter=true` `- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true` `- traefik.http.middlewares.n8n.headers.forceSTSHeader=true` `- traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}` `- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true` `- traefik.http.middlewares.n8n.headers.STSPreload=true` `- traefik.http.routers.n8n.middlewares=n8n@docker` `environment:` `- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}` `- N8N_PORT=5678` `- N8N_PROTOCOL=https` `- NODE_ENV=production` `- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/` `- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}` `volumes:` `- n8n_data:/home/username/n8n/n8n-local-files:/files` `volumes:` `traefik_data:` `external: true` `n8n_data:` `external: true` ---------------------------------------------------------------------- hdddanbrown · 2023-11-10 19:39 Can you format it so its readable? ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:40 version: "3.7" services: traefik: image: "traefik" restart: always command: \- "--api=true" \- "--api.insecure=true" \- "--providers.docker=true" \- "--providers.docker.exposedbydefault=false" \- "--entrypoints.web.address=:80" \- "--entrypoints.web.http.redirections.entryPoint.to=websecure" \- "--entrypoints.web.http.redirections.entrypoint.scheme=https" \- "--entrypoints.websecure.address=:443" \- "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true" \- "--certificatesresolvers.mytlschallenge.acme.email=${SSL\_EMAIL}" \- "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/a cme.json" ports: \- "3002:80" \- "6443:443" volumes: \- traefik\_data:/letsencrypt \- /var/run/docker.sock:/var/run/docker.sock:ro n8n: image: docker.n8n.io/n8nio/n8n restart: always ports: \- "127.0.0.1:5678:5678" labels: \- traefik.enable=true \- traefik.http.routers.n8n.rule=Host(\`${SUBDOMAIN}.${DOMAIN\_NAME}\`) \- traefik.http.routers.n8n.tls=true \- traefik.http.routers.n8n.entrypoints=web,websecure \- traefik.http.routers.n8n.tls.certresolver=mytlschallenge \- traefik.http.middlewares.n8n.headers.SSLRedirect=false \- traefik.http.middlewares.n8n.headers.STSSeconds=315360000 \- traefik.http.middlewares.n8n.headers.browserXSSFilter=true \- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true \- traefik.http.middlewares.n8n.headers.forceSTSHeader=true \- traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN\_NAME} \- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true \- traefik.http.middlewares.n8n.headers.STSPreload=true \- traefik.http.routers.n8n.middlewares=n8n@docker environment: \- N8N\_HOST=${SUBDOMAIN}.${DOMAIN\_NAME} \- N8N\_PORT=5678 \- N8N\_PROTOCOL=https \- NODE\_ENV=production \- WEBHOOK\_URL=https://${SUBDOMAIN}.${DOMAIN\_NAME}/ \- GENERIC\_TIMEZONE=${GENERIC\_TIMEZONE} volumes: \- n8n\_data:/home/username/n8n/n8n-local-files:/files volumes: traefik\_data: external: true n8n\_data: external: true ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:41 just as a user. followed this guide, docker compose section: https://docs.n8n.io/hosting/installation/docker/#updating Once it came backup, asking me to register again. ---------------------------------------------------------------------- cloudzhq · 2023-11-10 19:43 You use sqlite? What’s in your .n8n directory? And those volumes look a bit quirky. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:45 the volume is there, with the date i created it on oct 6. Just can't seem to find a way to use it (i'm new to docker). ---------------------------------------------------------------------- hdddanbrown · 2023-11-10 19:45 > volumes: \- n8n\_data:/home/username/n8n/n8n-local-files:/files What is that supposed to be? ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:47 the install instructions didn't say anything about a database. It just has you create a docker volume, n8n\_data. Pulled my entire history from command line, looks like i created a docker-compose.yml and then docker compose up -d. Trying to figure out which directions i followed. I did create the n8n\_data volume, i just assumed it would store the data in the volume. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:48 that was in the file. I'm new to docker but i thought it was telling it to use the n8n\_data volume and inside the container use that folder to mount it? ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:52 Here's the original i used. [https://docs.n8n.io/hosting/installation/server-setups/docker- compose/#3-install-docker- compose](https://docs.n8n.io/hosting/installation/server- setups/docker-compose/#3-install-docker-compose) until the update today, it was identical. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 19:56 Here's the original file i used. I didn't modify it. https://docs.n8n.io/hosting/installation/server-setups/docker- compose/#3-install-docker-compose ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 20:00 and just saw your sqlite question.. i copied the file from the link. it came up and ran. If the data I had is gone, trying to figure out how to make it persist. ---------------------------------------------------------------------- hdddanbrown · 2023-11-10 20:02 Its very different in the original. And Docker doesnt change your compose file, ever. So you fucked that up and your data that was supposed to be saved there is likely gone. If youre new to Docker then why not simply ask all of this in /r/Docker? ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 20:20 I've been trying to fix this for hours before i posted here. I accidentally copied a version i tried, in reading their docs and trying to fix it. I had a copy of the original after the update. It matches the link version exactly. I didn't touch the docker compose after i did the update. I shutdown n8n, pulled, brought it up. It was fucked up immediately. Searching, it's very common question for n8n's docker instance, doesn't seem to persist data. I didn't ask in r/Docker because I have 4 other containers I use. None of them lose data after I pull an update for the container. This didn't seem to be a docker issue. Switching it to my mysql db. I won't have to worry about it losing data in the future. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 20:21 A bit of reading and i now understand this question. The .n8n directory is empty. Not really sure what happened. Looks like everything is lost and i'll have to re-do it all. Switching it to use my mysql server so it doesn't happen again. ---------------------------------------------------------------------- cloudzhq · 2023-11-10 20:26 Your volumes are incorrect. That’s the reason why they are empty. They only existed in the docker. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 20:46 I'm learning that. ---------------------------------------------------------------------- cloudzhq · 2023-11-10 20:49 Yes you will. The secret is stored in a file in the volume. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 20:53 I said that then found they depreciated mysql lol. So I guess I'll figure out how to use the n8n-local-files folder they have you create. Mine us currently empty. ---------------------------------------------------------------------- cloudzhq · 2023-11-10 21:23 You can easily do PSQL. ---------------------------------------------------------------------- thekrautboy · 2023-11-10 21:47 From the [original compose file provided by n8n](https://docs.n8n.io/hosting/installation/server-setups/docker- compose/): volumes: - n8n_data:/home/username/n8n/n8n-local-files:/file Versus the one you posted: volumes: - n8n_data:/home/node/.n8n Clearly a difference, dont you agree? ---------------------------------------------------------------------- thekrautboy · 2023-11-10 21:55 Why not simply invest a bit of time to actually learn the basics of Docker? No matter if its n8n now or something else later, you will run into problems if you never actually learn anything about it. Simply copy/pasting things and clicking "Go!" is not going to work. So simply ask /r/Docker if you have Docker specific questions, or if you are unsure, ask on the support platform of the software you are trying to use, in this case, the n8n Github page where you can discuss problems. ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 22:17 Thought it was more of an n8n question. So I asked here. Since the other 3 containers update and don't lose data, seemed specific to their config. ---------------------------------------------------------------------- thekrautboy · 2023-11-10 22:20 > Thought it was more of an n8n question. Which is why i also said ---------------------------------------------------------------------- RowdyRidger19 · 2023-11-10 22:39 I created an account on their support forum and didn't get answer. Thought this was a community for self hosting. I see others ask for help. ---------------------------------------------------------------------- thekrautboy · 2023-11-10 22:48 Sure... ---------------------------------------------------------------------- tksintenn · 2023-11-10 23:09 Go read this subs intro. It's not "go ask in their support forum" it's a community to support each other. Your comments aren't helpful. ---------------------------------------------------------------------- thekrautboy · 2023-11-10 23:18 And maybe you should read more than just the intro. ---------------------------------------------------------------------- tksintenn · 2023-11-10 23:35 I usually lurk. Stand by what I said. ---------------------------------------------------------------------- thekrautboy · 2023-11-10 23:36 So youre not being helpful then, ever?