Restore n8n or Import old database

Describe the problem/error/question

I made a rookie move and didnt backup my workflows before making hardware changes and now cannot get the server back online. I installed n8n on a Dell Poweredge R410 running Ubuntu Server 22.04. I used this guide from i12bretro (Install n8n - Open Source Workflow Automation - on Linux) to install. I probably bit off more than I should have but everything was working great until the hardware change. Since I couldn’t get the server up, I was able to pull the drive from the server and mount it on another machine. I tried running the export functions to get the workflows but it doesn’t work. I tried backing up the entire root directory and updating a fresh install and that didn’t work. Since I think all the workflow/credentials are held in the database I was wondering if it was possible to just backup the database and utilize that on a fresh install of n8n? Would that work? Please help!

What is the error message (if any)?

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:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu Server 22.04

Hi @wtheory, I’m sorry you’re having trouble. It seems like that tutorial uses a MariaDB database. Can you confirm what exactly you have tried when trying to re-use your existing data? Which error exactly did you see?

Since I think all the workflow/credentials are held in the database I was wondering if it was possible to just backup the database and utilize that on a fresh install of n8n? Would that work? Please help!

Yes, you can in theory import data directly into a database. I don’t have a step-by-step description for MariaDB though I am afraid, but I did something similar a while back with Postgres over here: How to migrate from SQLite to PostgreSQL? - #5 by MutedJam. This post is very old though, so in addition to the different database system there also have been a few additional tables since which you’d need to account for. Also, make sure to copy the config file in your old .n8n directory as this would include the encryption key required to read your credentials.

@MutedJam Thank you very much for your input. Luckily I found that I had downloaded some individual workflow files so I wasn’t completely empty handed. As far as migration of the db I wasn’t able to get very far. Just above my head and I needed them quickly. Luckily I had learned so much while creating the the originals I was able to quickly re-create and even improve my flows. I really appreciate the time and effort you extend to answer all these questions and love this software and this community. Thank you.

3 Likes

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