# Support - I broke my PostgreSQL Installation

**URL:** https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347
**Category:** Support
**Tags:** english
**Created:** [October 9, 2025, 3:25pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347 "2025-10-09T15:25:49Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 3:25pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/1 "2025-10-09T15:25:49Z")

</div>

**What type of hardware are you using** : Virtual machine  
**What YunoHost version are you running** : 12.1.27  
**How are you able to access your server** : The webadmin  
SSH  
Direct access via physical keyboard/screen  
**Are you in a special context or did you perform specific tweaking on your YunoHost instance ?** : i tried to reinstall immich

### Describe your issue

Some weeks ago during an update my immich installation broke - the backup didn’t work so tried to reinstall the app and ran into several issues. The language and the format weren’t correct etc. So I tried to repair it with help from the internet by removing legacy parts off installed postgres-installation which hat no dependencies

I followed also this thread as well:

> [@After installing Joplin : "Error: Postgres version not supported"](https://forum.yunohost.org/t/after-installing-joplin-error-postgres-version-not-supported/31741/4):
>
> It was : $ sudo pg\_lsclusters Ver Cluster Port Status Owner Data directory Log file 11 main 5432 online postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log 15 main 5433 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log I don’t have the right version apparently : postgresql-15

Now I’m still not able to reinstall my immich instance as well my paperless server is not reachable anymore.

If I can provide specific logs or terminal output I’m very greatful for your help  
Thanks in advance

### Share relevant logs or error messages

[https://paste.yunohost.org/raw/duhopuyoci](https://paste.yunohost.org/raw/duhopuyoci)

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 4:29pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/2 "2025-10-09T16:29:29Z")

</div>

Hello @nr458h  
This is going to be a bit tricky since we don’t know what has been modified or deleted, but we’ll see what we can do.

1. Check which port each installed version of PostgreSQL is listening on your server:

```auto
sudo pg_lsclusters

```

postgresql 15 should listen on 5432.

1. Then connect to the version using 5432 port and look for a paperless database

```auto
sudo -u postgres psql -p 5432 -c "\l"

```

1. Backup your database

```auto
sudo -u postgres -p 5432 pg_dump -d paperless* -F p -f /tmp/paperless_bak.sql

```

- \*database name may be different: see the output of step 2

1. You may now have to change `paperless_ngx` user password:

```auto
sudo -u postgres psql -p 5432 -d paperless* -c "ALTER USER paperless_ngx WITH PASSWORD '<password set in /etc/yunohost/apps/paperless_ngx/settings.yml:db_password';"

```

It should be the same for immich.

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 7:21pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/3 "2025-10-09T19:21:54Z")

</div>

Thanks for the quick response.

1. running the commant shows that postgres 16/17 are installed as well, the output is:

```auto
Ver Cluster Port Status Owner Data directory Log file
15 main 5499 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postresql-15-main.log
16 main 5498 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postresql-16-main.log
17 main 5432 online postgres /var/lib/postgresql/17/main /var/log/postgresql/postresql-17-main.log

```

So if I run the second step I get an output but only after switching to root with su, with sudo I get an error.  
Two questions remain for me:

1. how do I change the port?
2. My sorting and my typset is set to de\_DE.UTF-8 what got me in trouble in the first place - should I switch it to en and how do I do that?

Thanks in advance

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 8:22pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/4 "2025-10-09T20:22:45Z")

</div>

> [@nr458h](#):
>
> ```auto
> Ver Cluster Port Status Owner Data directory Log file
> 15 main 5499 online postgres /var/lib/postgresql/15/main /var/log/postgresql/postresql-15-main.log
> 16 main 5498 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postresql-16-main.log
> 17 main 5432 online postgres /var/lib/postgresql/17/main /var/log/postgresql/postresql-17-main.log
> 
> ```

Check if there is an existing paperless database on one of the three psql versions installed.

> [@nr458h](#):
>
> how do I change the port?

NB: Before changing port, check which databases are available on each version of psql. Changing port will break apps if you can’t update this param in their settings.

For example, for psql 15

```auto
sudo nano /etc/postgresql/15/main/postgresql.conf

```

edit value of `port` key

```auto
sudo systemctl restart postgresql@15-main

```

> [@nr458h](#):
>
> My sorting and my typset is set to de\_DE.UTF-8 what got me in trouble in the first place - should I switch it to en and how do I do that?

It worked before with de\_DE, didn’t it ?

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 9:40pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/5 "2025-10-09T21:40:00Z")

</div>

Thank you for your help - while paperless is running again after restarting postgresql the version 16 is shown as down.  
Also the installation-script for immich is failing - it seems the postgresql 16 installation is somewhat broken …  
[https://paste.yunohost.org/raw/uyiwicisuj](https://paste.yunohost.org/raw/uyiwicisuj)  
Any idea how to continue?

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 10:01pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/6 "2025-10-09T22:01:41Z")

</div>

Try to restart it `sudo pg_ctlcluster 16 main start`, then check its status.

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 10:10pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/7 "2025-10-09T22:10:36Z")

</div>

```auto
sudo pg_ctlcluster 16 main start
.../16/main is not accessible or does not exist

.../postgresql# ls
15 

```

I think postgresql 16 wasn’t properly setup by immich, there is no folder. Force reinstall doesn’t help.  
Do I need to create the folder by myself?

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 10:13pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/8 "2025-10-09T22:13:21Z")

</div>

> [@nr458h](#):
>
> `16 main 5498 online postgres /var/lib/postgresql/16/main /var/log/postgresql/postresql-16-main.log`

But how did it disappear 🤔?? Did you manually remove it ?

> [@nr458h](#):
>
> Do I need to create the folder by myself?

Immich is meant to install it…

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 10:16pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/9 "2025-10-09T22:16:50Z")

</div>

> [@otm33](#):
>
> But how did it disappear 🤔?? Did you manually remove it ?

Not intentonaly. Before asking for help I followed this instructions … [After installing Joplin : "Error: Postgres version not supported" - #12 by blodarn](https://forum.yunohost.org/t/after-installing-joplin-error-postgres-version-not-supported/31741/12)  
But as far as I can tell - I only uninstalled postgresql-16 and didn’t remove the data.

In the logs I saw that immich is forcing a reinstall of postgresql-16 as well and then aborts because there is no response from the set port.  
How can I fix that - or is this an upstream (immich) problem?

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 10:30pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/10 "2025-10-09T22:30:53Z")

</div>

I would try to reinstall immich It seems very curious to me that immich is trying port 5498 again if PostgreSQL 16 has been uninstalled…

If it fails again, you can try installing manually postgresql 16

```auto
sudo apt install postgresql-16
sudo pg_createcluster 16 main --start

```

and then reinstall immich

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 10:50pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/11 "2025-10-09T22:50:04Z")

</div>

Thanks man for your patients and your support. But after running your commands it still not working - now I do have a folder in postgresql/ → 16 but this folder is empty ???

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 10:57pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/12 "2025-10-09T22:57:00Z")

</div>

```auto
sudo pg_lsclusters
sudo pg_dropcluster 16 main --stop
sudo pg_createcluster 16 main --start
sudo pg_lsclusters

```

The previous uninstallation of postgresql may have been incomplete ?

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 9, 2025, 11:13pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/13 "2025-10-09T23:13:40Z")

</div>

Thanks - it seemed to work - the installation process is still runing.

---

<div class="post-metadata">

### Author: ![otm33](https://forum.yunohost.org/user_avatar/forum.yunohost.org/otm33/32/11941_2.png) [@otm33](https://forum.yunohost.org/u/otm33)
#### Post date: [October 9, 2025, 11:29pm UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/14 "2025-10-09T23:29:45Z")

</div>

Soooooo… ??

---

<div class="post-metadata">

### Author: ![nr458h](https://forum.yunohost.org/user_avatar/forum.yunohost.org/nr458h/32/6963_2.png) [@nr458h](https://forum.yunohost.org/u/nr458h)
#### Post date: [October 10, 2025, 6:45am UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/15 "2025-10-10T06:45:06Z")

</div>

Thanks @otm33 it worked out everything. I marked the solution.

The problem were the following:

- wrong port in first place for postgresql-15
- the other postgresql instances were somewhat broken/not correctly installed by the application with the marked solution it is possible to fix the postgresql installation, afterwards it is nessesary to restart. If the expected port durring an installation differs from the actuall port you can change the port with the commands from the linked thread.

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [November 9, 2025, 6:45am UTC](https://forum.yunohost.org/t/support-i-broke-my-postgresql-installation/40347/16 "2025-11-09T06:45:50Z")

</div>

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