# Paperless doesn't start

**URL:** <https://forum.yunohost.org/t/paperless-doesnt-start/41144>\
**Category:** Support apps\
**Tags:** paperless-ngx, english\
**Created:** [December 23, 2025, 10:48am UTC](https://forum.yunohost.org/t/paperless-doesnt-start/41144 "2025-12-23T10:48:23Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![djez](https://forum.yunohost.org/user_avatar/forum.yunohost.org/djez/32/736_2.png) [@djez](https://forum.yunohost.org/u/djez)\
**Post date:** [March 3, 2026, 4:16pm UTC](https://forum.yunohost.org/t/paperless-doesnt-start/41144/15 "2026-03-03T16:16:16Z")

</div>

Hi @jedie,

This is exactly the same issue I described in the [other topic](https://forum.yunohost.org/t/2-postgres-instance/41484/2). Your PostgreSQL migration from 13 to 15 didn’t complete properly → the old cluster (v13) is still listening on port 5432 (the default), so all your apps connect to it instead of the newer v15 cluster. That’s why Django complains about “PostgreSQL 14 or later is required (found 13.20)”.

Here’s how to fix it. **All commands assume you’re working as root.**

* * *

**Step 0 → Get a clear picture of your clusters:**

```auto
pg_lsclusters

```

This will show you all running clusters with their version, port, and status. You likely have something like:

- **v13** on port **5432** (the problematic one → apps connect here by default)
- **v15** on port **5433** (the one that should be used)
- **v16** on port **5434** (likely used by Immich, with pgvector → **don’t touch this one** )

Note down the exact ports before proceeding.

* * *

**Step 1 → Check which databases exist on each cluster:**

```auto
# Databases on the v13 cluster (likely port 5432)
sudo -u postgres psql -p 5432 -l

# Databases on the v15 cluster (likely port 5433)
sudo -u postgres psql -p 5433 -l

```

→ Compare both lists. If all your app databases (paperless-ngx, and any other) are already present on the v15 cluster, skip to Step 2. If some databases **only exist on v13 and are missing from v15** , you need to migrate them manually first → see Step 1.1 below.

**Step 1.1 → Manually migrate a database from v13 to v15 (only if needed):**

For each database that exists on v13 but is missing from v15, follow this procedure. Replace `<dbname>` and `<dbuser>` with the actual values.

First, identify the database owner on v13:

```auto
sudo -u postgres psql -p 5432 -c "\l" | grep <dbname>

```

Find the app’s database password in its YunoHost settings:

```auto
cat /etc/yunohost/apps/<appname>/settings.yml | grep db_pwd

```

Dump the database from the v13 cluster:

```auto
sudo -u postgres pg_dump -p 5432 <dbname> > /tmp/<dbname>.sql

```

Make sure the role (user) exists on the v15 cluster:

```auto
sudo -u postgres psql -p 5433 -c "\du" | grep <dbuser>

```

If the role doesn’t exist, create it (use the password from the settings above):

```auto
sudo -u postgres psql -p 5433 -c "CREATE ROLE <dbuser> WITH LOGIN PASSWORD '<the_password>';"

```

Create the database on v15 and restore the dump:

```auto
sudo -u postgres psql -p 5433 -c "CREATE DATABASE <dbname> OWNER <dbuser>;"
sudo -u postgres psql -p 5433 <dbname> < /tmp/<dbname>.sql

```

Verify the data is there:

```auto
sudo -u postgres psql -p 5433 -c "\dt" <dbname>

```

Clean up:

```auto
rm /tmp/<dbname>.sql

```

Repeat for each missing database, then proceed to Step 2.

* * *

**Step 2 → Check which apps use PostgreSQL:**

```auto
grep -r "db_type\|psql\|postgres" /etc/yunohost/apps/*/settings.yml

```

This helps you know which apps will be affected by the port change.

* * *

**Step 3 → Stop the old v13 cluster** (safe first step → don’t delete it yet):

```auto
pg_ctlcluster 13 main stop

```

* * *

**Step 4 → Reconfigure the v15 cluster to use port 5432:**

```auto
systemctl stop postgresql@15-main
nano /etc/postgresql/15/main/postgresql.conf
# Change: port = 5433 → port = 5432
systemctl start postgresql@15-main

```

* * *

**Step 5 → Verify:**

```auto
pg_lsclusters

```

You should see:

- **v15** on port **5432** , status **online**
- **v13** stopped/down
- **v16** unchanged on its own port (if applicable)

At this point, you can test that your existing apps still work properly.

* * *

**Step 6 → Once everything works, remove the old v13 cluster and packages:**

```auto
pg_dropcluster 13 main
apt remove postgresql-13 postgresql-client-13

```

* * *

**Step 7 → Upgrade paperless-ngx:**

Since normal upgrades fail and roll back automatically, use the approach suggested by @orhtej2:

1. First, make a full backup:

2. Then upgrade without safety backup (so it won’t roll back on failure):

3. If the `psycopg-c` issue still occurs after upgrade, apply the fix:

* * *

**Important note about PostgreSQL 16:** You have `postgresql-16-pgvector` installed, which is very likely used by Immich (or a similar app). This cluster should be running on its own port (probably 5434) and **should not be affected** by the changes above. Just make sure you don’t touch it during this process. You can verify with `pg_lsclusters` which port v16 uses.

Good luck! 🙂

---

_[View the full topic](https://forum.yunohost.org/t/paperless-doesnt-start/41144)._
