93 lines
2.1 KiB
Markdown
93 lines
2.1 KiB
Markdown
# n8n upgrade to 2.30.5
|
|
|
|
Prepared: 2026-07-15T10:28Z
|
|
|
|
## Current state
|
|
|
|
- Current running version before upgrade: `2.22.5`
|
|
- Target version: `2.30.5`
|
|
- Target image pulled locally: `n8nio/n8n:2.30.5`
|
|
- Target image digest: `sha256:450853cd21a2ce36587c4c860eb26927c1ceba9496bf55f4c213b5d3a6dc8c6f`
|
|
- Previous image digest: `sha256:a49bc161141d6c4b9c495b5a6e3c7c1932e61d2ed2fe3fdca01262064b4b23ca`
|
|
|
|
## Backup
|
|
|
|
Backup directory:
|
|
|
|
```bash
|
|
/opt/backups/n8n-upgrade-20260715T102759Z
|
|
```
|
|
|
|
Contents:
|
|
|
|
- `n8n-postgres.dump`
|
|
- `n8n-data.tgz`
|
|
- `SHA256SUMS`
|
|
|
|
Verify backup:
|
|
|
|
```bash
|
|
sudo sha256sum -c /opt/backups/n8n-upgrade-20260715T102759Z/SHA256SUMS
|
|
sudo cat /opt/backups/n8n-upgrade-20260715T102759Z/n8n-postgres.dump | docker exec -i n8n-pg pg_restore -l | head
|
|
sudo tar -tzf /opt/backups/n8n-upgrade-20260715T102759Z/n8n-data.tgz | head
|
|
```
|
|
|
|
## Upgrade
|
|
|
|
```bash
|
|
cd /home/felidae/Portainer_repo/n8n
|
|
docker compose --env-file .env up -d n8n
|
|
```
|
|
|
|
## Verification
|
|
|
|
```bash
|
|
docker exec n8n n8n --version
|
|
docker ps --filter name=n8n --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
|
|
health-results
|
|
docker logs --since 10m n8n
|
|
```
|
|
|
|
Expected:
|
|
|
|
- `docker exec n8n n8n --version` prints `2.30.5`
|
|
- `health-results` reports `11/11 up`
|
|
- No recurring `ERR_ERL_UNEXPECTED_X_FORWARDED_FOR`
|
|
|
|
## Rollback
|
|
|
|
If the container fails to start or workflows fail after migration:
|
|
|
|
1. Stop n8n:
|
|
|
|
```bash
|
|
docker compose --env-file .env stop n8n
|
|
```
|
|
|
|
2. Restore the previous image in `docker-compose.yml`:
|
|
|
|
```yaml
|
|
image: n8nio/n8n@sha256:a49bc161141d6c4b9c495b5a6e3c7c1932e61d2ed2fe3fdca01262064b4b23ca
|
|
```
|
|
|
|
3. If DB migrations need rollback, restore Postgres from backup. This is destructive to current n8n DB state:
|
|
|
|
```bash
|
|
docker compose --env-file .env stop n8n
|
|
docker exec -i n8n-pg dropdb -U n8n n8n
|
|
docker exec -i n8n-pg createdb -U n8n n8n
|
|
sudo cat /opt/backups/n8n-upgrade-20260715T102759Z/n8n-postgres.dump | docker exec -i n8n-pg pg_restore -U n8n -d n8n --clean --if-exists
|
|
```
|
|
|
|
4. Restore `/opt/n8n/data` only if needed:
|
|
|
|
```bash
|
|
sudo tar -C /opt/n8n -xzf /opt/backups/n8n-upgrade-20260715T102759Z/n8n-data.tgz
|
|
```
|
|
|
|
5. Start old n8n:
|
|
|
|
```bash
|
|
docker compose --env-file .env up -d n8n
|
|
```
|