How-to

Upgrading Self-Hosted n8n to 2.x: What Broke, What the Migration Report Missed, and How to Roll Back (Tested, 2026)

By The Automated Shop team · Updated November 25, 2026 · 12 min read

Some links below are affiliate links. If you buy through them we may earn a commission at no extra cost to you. It doesn't change our test results. How we make money.

Tested November 25, 2026 on n8n Community Edition 1.123.101 (the newest 1.x release, from November 23), 2.44.6 and 2.49.6 (the npm stable release that day). We self-hosted with npm on Node.js 24 on our own test server, using both the default SQLite database and PostgreSQL 17.5. We didn't test Docker. Each 1.x instance had the same 9 test workflows and about 6,000 real webhook executions. To see how migration time grows, we also upgraded a copy of the SQLite instance with its execution rows duplicated to 96,224 (413 MB). Behavior is checked against n8n's 2.0 breaking changes, Update n8n and Back up and restore docs. We couldn't test n8n Cloud, because our trial has ended.

If you self-host n8n and the version at the bottom of your Settings sidebar starts with 1, you have a deadline. n8n's help center (last updated October 26) says 1.x support ends on December 31, 2026. The banner inside our 1.123.101 instance said 31 January 2027. Plan for the earlier date. There's also no direct path from 1.x to 3.0: per the same help center page, you have to move to 2.x first.

We built the kinds of workflows small businesses run, upgraded them, and then tried every way back.

Short version:

  • The upgrade itself is fast. The breakage is the problem. 1.123.101 to 2.49.6 ran 238 database migrations on SQLite (245 on Postgres) and was ready in 9.3 seconds (7.2 on Postgres). The 96,224-execution copy took 7.9 seconds. Execution history and credentials came through. But 6 of our 8 test workflows failed on their first run, and n8n still showed every one of them as Published.
  • The Migration Report found 4 of the 6. It told us "5 of your 9 workflows are already compatible". Three of those five failed: the parent of a flagged sub-workflow, plus two the report never mentioned, one that reads $env in a Code node and one that uses $evaluateExpression. It also missed $env in a regular expression field. The free pre-check template on this page found all of them.
  • Four environment variables fixed 4 of the 6 after one restart. The other two needed edits: a sub-workflow still on the old Start node, and a Python Code node.
  • The only rollback that worked properly was restoring the backup. n8n db:revert refused at the first step ("The last migration was irreversible") and exited with status 0. Starting 1.123.101 on the upgraded database did work, but it put a half-finished, unpublished draft live. Restoring our backup took under a second, and n8n was back up 2.2 seconds later.
  • Within 2.x, it was uneventful. 2.44.6 to 2.49.6 ran 57 migrations in 6.3 seconds, and nothing broke. Going back to 2.44.6 without a restore also worked in our test. n8n doesn't promise that, so keep the backup anyway.

Test 1: what broke in 1.x to 2.x

Our 1.x instance had 9 workflows: the 8 below, plus a child workflow that the parent calls. Each one worked on 1.123.101. We stopped n8n, backed it up, started 2.49.6 on the same data, sent each webhook a request and checked the schedule's next run.

Test workflow On 2.49.6 What n8n said
Lead intake webhook with Header Auth credential Worked (200, wrong secret still 403)
Schedule Trigger, every minute Worked
Code node reads $env.SHOP_API_BASE Failed (500) "access to env vars denied"
Code node uses $evaluateExpression Failed (500) "$evaluateExpression can't be used in the Code node while task runners run in secure mode"
Read/Write Files node reads a price-list CSV Failed (500) "Access to the file is not allowed."
Python Code node Failed (500) "Python runner unavailable: Virtual environment is missing from this system"
Parent workflow calls a child that starts with the old Start node Failed (500) "Workflow is not active and cannot be executed."
Execute Command node (echo) Failed (400, no execution saved) "Unrecognized node type: n8n-nodes-base.executeCommand"

Postgres gave the same results, row for row. Two details make this worse than it looks:

  1. Nothing looks wrong until a workflow runs. n8n started cleanly. All 8 of our active workflows came through as Published, including the 6 broken ones. The first sign of trouble is a failed execution.
  2. The Execute Command workflow didn't fail in the executions list. It never ran. The webhook answered 400 and n8n saved no execution, so there was nothing in the list to see. Whatever was calling that webhook got an error, and nothing showed up inside n8n.
n8n 2.49.6 executions list: Parent calls child Error, Read price list file Error, Python Code node Error, Code node uses $evaluateExpression Error, Code node reads $env Error, while Lead intake (header auth) and Every minute heartbeat show Success
First requests after the upgrade (here on the 96,224-execution copy). The Execute Command workflow doesn't appear at all, because it never started.
n8n 2.49.6 workflow list: Every minute heartbeat, Parent calls child, Read price list file, Execute Command node and Python Code node all carry a green Published badge; Child: legacy Start node has none
The broken workflows still say Published. The child with the old Start node was never active, and 1.x didn't need it to be. 2.x won't call a sub-workflow that isn't published, so its parent failed.

The $env failure is the one we'd expect to hit most small businesses. Putting an API base URL or a sender address in an environment variable and reading it with $env is common. In 2.x, N8N_BLOCK_ENV_ACCESS_IN_NODE defaults to true. We also added a regular Edit Fields (Set) node with {{ $env.SHOP_API_BASE }} in a field. It failed on 2.49.6 too, so this isn't only about Code nodes.

n8n 2.49.6 execution view for Code node reads $env: workflow badge says Published, execution Error in 41ms, ID 6016, Code node marked red, message Problem in node Code: access to env vars denied
Published, and failing on every request.

Test 2: what the Migration Report catches

Our 1.123.101 instance had a Settings → Migration Report page and a banner pointing to it. n8n's help center tells you to run it before upgrading.

n8n 1.123.101 Migration Report: banner says n8n v1 reaches end of support on 31 January 2027. Compatibility report for version 2.0.0: 5 of your 9 workflows are already compatible. Workflow issues 4: Remove Pyodide-based Python in Code node, File Access Restrictions, Disable ExecuteCommand and LocalFileTrigger nodes by default, Start node removed, each Medium, 1 workflow
The report on our 1.x instance. Two of the "5 compatible" workflows failed after the upgrade.

It listed 4 workflow issues and 9 instance issues, all rated Medium or Low. None were Critical, even though every flagged workflow failed. It missed:

  • $env in a Code node. The report's rule looks for process.env. We then added a Code node that uses process.env and refreshed the report. That wasn't flagged either.
  • $env in an expression in an Edit Fields node.
  • $evaluateExpression in a Code node, which n8n's own breaking-changes page lists.

We also tried a rehearsal: running 1.123.101 with the 2.0 defaults switched on (N8N_RUNNERS_ENABLED=true, N8N_BLOCK_ENV_ACCESS_IN_NODE=true, Execute Command excluded, file access limited to one folder). That reproduced 4 of the 6 failures: $env, $evaluateExpression, Execute Command and the file read. It didn't catch the Python node or the Start-node sub-workflow, which the report does flag. Run both, or use our pre-check template. In our test, only the combination found all six.

Test 3: fixing it after the upgrade

We restarted 2.49.6 with four environment variables from n8n's breaking-changes page:

N8N_BLOCK_ENV_ACCESS_IN_NODE=false
NODES_EXCLUDE=[]
N8N_RESTRICT_FILE_ACCESS_TO=/path/to/your/files
N8N_RUNNERS_INSECURE_MODE=true

After one restart, the $env, $evaluateExpression, Execute Command and file workflows all worked. These settings turn 2.x security changes back off, though. n8n's docs call insecure mode a temporary workaround, and NODES_EXCLUDE=[] lets any workflow editor run shell commands on your server. Use them to get back up fast, then fix the workflows: move secrets into credentials, and do the $evaluateExpression work in an Edit Fields node before the Code node.

The other two needed changes to the workflows themselves:

  • Start-node sub-workflow: we replaced Start with an Execute Workflow Trigger and saved. The parent still failed. It worked only after we also published the child. Saving isn't enough in 2.x.
  • Python Code node: 2.x needs a separate Python task runner (n8n's docs: external mode, the n8nio/runners image). We didn't set one up. If your Python node does something simple, rewriting it in JavaScript is the quicker fix.

Test 4: going back

Here's what we tried after the 1.x to 2.x upgrade, on copies of the same instance.

Rollback method Result
n8n db:revert (run with 2.49.6, as n8n's docs describe) Refused. "Cancelled command. The last migration was irreversible." Exit status 0. 0 of 238 migrations reverted (SQLite); same on Postgres.
Start 1.123.101 on the upgraded database Started in 2.2 seconds, and all 8 test workflows ran again. But an unpublished draft went live (details below).
Restore the pre-upgrade backup, start 1.123.101 Clean. SQLite: unpacking the backed-up .n8n folder took 0.14 s, n8n was ready 2.2 s later, 8 of 8 workflows worked. Postgres: createdb plus pg_restore took 0.5 s.
Restore the Postgres backup without the old .n8n folder Started in 1.5 s with a new encryption key ("No encryption key found - Auto-generating"). The Header Auth webhook answered 500 to the right secret and the wrong one. Workflows without credentials still ran. Expect every credential to fail the same way, because they're all encrypted with the lost key.

The draft problem. In 2.x, saving a workflow creates a draft. The published version keeps running until you publish again. On 2.49.6 we changed the lead-intake workflow's status field to "DRAFT - half-finished edit, not published" and saved without publishing. 2.49.6 kept answering "saved". Then we started 1.123.101 on the same database, and the next lead got this response (line breaks added):

{"name": "Dana",
 "email": "[email protected]",
 "status": "DRAFT - half-finished edit, not published"}

1.x doesn't know about drafts, so it runs whatever was saved last. If anyone edited workflows during your time on 2.x, going back without a restore can put unfinished work live.

What a restore costs. It throws away everything since the backup. In our test, that was 24 executions recorded during the roughly 7 minutes we spent on 2.x, plus the fixes we'd made. Decide on rollback within the first hour if you can.

One more thing that will catch Postgres users: the database dump isn't a full backup. n8n encrypts credentials with a key stored in the .n8n folder (config file), or in N8N_ENCRYPTION_KEY if you set it. Back up both.

Test 5: an update within 2.x

For comparison, we upgraded 2.44.6 instances (3,000 executions each) to 2.49.6. SQLite ran 57 migrations and was ready in 6.3 seconds; Postgres ran 59 in 5.7 seconds. The webhook with Header Auth and a parent calling an Execute Workflow Trigger child both kept working.

Then we started 2.44.6 again on the upgraded databases, without restoring. It started in 4.7 seconds and logged "Recorded version change: 2.49.6 -> 2.44.6". Existing workflows ran, the every-minute schedule kept running, and we could edit and save. One warning sign: a newly published webhook returned 404 right after publishing and only worked when we retried 85 seconds later. On a fresh 2.44.6, new webhooks answered immediately. n8n's update docs say switching the version back "doesn't reverse database migrations", and they don't present this as a rollback method. It worked for us with five simple workflows. We wouldn't count on it with more.

What we'd do

If you're on 1.x:

  1. Find your problem workflows on 1.x first. Run Settings → Migration Report and the pre-check template on this page. Search your workflows for $env, $evaluateExpression, Execute Command, file nodes, Python Code nodes and Start nodes.
  2. Fix what you can while still on 1.x. Move values out of $env into credentials, replace Start nodes, and rewrite Python Code nodes in JavaScript. All of these also work on 1.x.
  3. Stop n8n, then back up the database and the .n8n folder together. With SQLite, the database is in that folder. With Postgres, run pg_dump -Fc as well. Our backups took 0.3 seconds for 6,000 executions and 2.0 seconds for 96,000.
  4. Write down the newest migration (SELECT name FROM migrations ORDER BY id DESC LIMIT 1;). n8n's docs recommend it, and it tells you which version the database is on.
  5. Upgrade to a pinned 2.x version, not latest. Then send one test request to every workflow that matters, or check that its next scheduled run succeeds.
  6. Don't edit workflows until you've decided to stay. If you have to go back, restore the backup. Don't start 1.x on the upgraded database.
  7. Add an error workflow before you upgrade, so failures reach you. We didn't test it here, but an error workflow reacts to failed executions, and the Execute Command webhook didn't create one.

If you're already on 2.x: update about once a month, as n8n's docs suggest. Minor jumps were quick and quiet in our test. Back up first anyway. The 3.0 beta (planned for October 27, per n8n's help center) wasn't on npm when we tested, so it isn't covered here.

Set up the template

The template is a pre-check you run on your 1.x instance before upgrading. It doesn't change anything.

  1. Download the template from the box on this page and import it into n8n (open a new workflow and paste the file's contents onto the canvas).
  2. Go to Settings → n8n API and create an API key.
  3. Open Get all workflows and create an n8n API credential. Paste the key, and set the Base URL to your instance address followed by /api/v1.
  4. Click Execute workflow. Open Find 2.x breaking changes to see one row per problem: the workflow, the node, the issue and the fix.
n8n 1.123.101 canvas: sticky note with setup steps, then Run the check, Get all workflows (14 items), Find 2.x breaking changes (8 items)
The pre-check on our 1.x test instance: 14 workflows in, 8 problems out.

On our 1.x test instance, it returned 8 rows. Six are the causes of our 6 failures (the Start node shows up on the child, which is what broke the parent). The other two are the $env Edit Fields and process.env Code workflows we added later. The Migration Report flagged 4 of those 8. The pre-check only knows the patterns we tested, so run the Migration Report as well. It also covers instance settings, which the template doesn't.

On n8n Cloud, n8n runs the upgrade for you. Its help center says self-serve Cloud instances still on v1 at the deadline will be moved to v2 automatically. Run the Migration Report there before that happens. We couldn't test Cloud. Starter was $24 a month billed monthly, or $20 a month billed annually, for 2,500 executions on the pricing page when we checked on November 25, 2026. Pro was $60, or $50 billed annually, for 10,000. Try n8n Cloud (affiliate link). The trial needs no card. Weighing the two? See n8n self-hosted vs Cloud. If your workflows use webhooks, the upgrade is also a good time to check them against our webhook security tests.

FAQ

How long does the n8n 2.0 upgrade take? In our tests, the database part took under 10 seconds: 9.3 s on SQLite with 6,000 executions, 7.9 s with 96,000, and 7.2 s on Postgres. Plan most of your time for testing workflows afterwards.

Will my credentials and execution history survive the upgrade? Yes, in our test, as long as n8n starts with the same .n8n folder or N8N_ENCRYPTION_KEY. All 6,000+ executions were still there, and the Header Auth credential still worked.

Can I downgrade n8n after upgrading? Restoring the backup you took before the upgrade worked every time. n8n db:revert refused on the first migration. Starting the old version on the upgraded database ran, but on 1.x it put an unpublished draft live.

Why does my Code node say "access to env vars denied" after upgrading? n8n 2.x blocks $env by default, in Code nodes and in expressions. Move the value into a credential, or set N8N_BLOCK_ENV_ACCESS_IN_NODE=false as a stopgap.

Can I go straight from n8n 1.x to 3.0? No. n8n's help center says to move to v2 first.

Does The Automated Shop earn a commission from n8n? Yes, if you sign up through our "Try n8n Cloud" link, which is an affiliate link. It costs you nothing extra and doesn't change our test results. Citation links to n8n's docs and pricing page carry no referral tag. See our affiliate disclosure.

Weekly dispatch

One automation you can steal, every week

One working automation per email, with the spec and what it costs to run. Unsubscribe from any email.