N8n cli migrate

From 8Dvibes/n8n-cli · View interactive version

N8n cli migrate is an AI agent skill from the GitHub repository 8Dvibes/n8n-cli. Migrate n8n workflows between instances (cloud to self-hosted or vice versa). Exports, remaps credentials, and imports in one pass. Use when moving workflows across n8n environments.

How to use this skill

Skill file

/n8n-migrate — Migrate Workflows Between n8n Instances

Move workflows from one n8n instance to another with credential remapping.

Arguments

Procedure

Step 1: Export from Source

# Single workflow
n8n-cli --profile <source> workflows export <id> -o /tmp/migrate-wf.json

# All workflows
n8n-cli --profile <source> --json workflows list > /tmp/migrate-list.json
# Then export each one

Step 2: Map Credentials

# List credentials on both instances
n8n-cli --profile <source> --json credentials list > /tmp/creds-source.json
n8n-cli --profile <target> --json credentials list > /tmp/creds-target.json

Compare credential types between instances. For each credential referenced in the workflow:

  1. Find the matching credential type on the target instance
  2. If a match exists, update the credential ID in the workflow JSON
  3. If no match, flag it for manual creation

Step 3: Clean and Import

Strip source-specific fields from the workflow JSON:

n8n-cli --profile <target> workflows import /tmp/migrate-wf-remapped.json

Step 4: Verify

n8n-cli --profile <target> workflows get <new-id>

Available Profiles

Output

Report for each migrated workflow:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.