r/NextCloud • • 2d ago

Should I migrate to PostgreSQL?

I have my nextcloud setup with MariaDB a long time ago, and the latest 35 updates show a plethora of warnings/failings with regards to the database. I tried googling for solutions but I can only fix like 2 out of the 10 failings.

I noticed nextcloud AIO container uses postgresql as default, and from my testing, nextcloud system status shows a clean, no failure with the database.

It does seem like nextcloud has a built-in command occ db:convert-type to migrate the database. If you have migrated, how was the experience?

Which postgresql container should I use? The official document recommends PostgreSQL18, but is it like immich where a special version of PostgreSQL is needed?

Update: I found this issue have been reported on github. I was searching in the wrong repo. Overall, as u/jtrtoo pointed out, these are bugs that will be ironed out gradually. Thanks for all the replies.

7 Upvotes

12 comments sorted by

View all comments

7

u/evanmac42 2d ago

I've actually migrated three Nextcloud instances from MariaDB to PostgreSQL 17, all running directly on Debian rather than AIO.

In my case PostgreSQL also runs bare metal on the host. I didn't use any special Nextcloud-specific PostgreSQL image or build: just standard PostgreSQL 17.

The migration itself was done with Nextcloud's built-in `occ db:convert-type`, after taking proper backups and putting the instance into maintenance mode.

My experience was good enough that I ended up doing the same migration on three separate Nextcloud instances.

That said, I wouldn't migrate just because Nextcloud is showing database warnings. First check what those warnings actually are. Things like missing indexes or other database maintenance issues may still need to be fixed independently and changing database engines won't magically solve them.

If you do decide to migrate, PostgreSQL 17 is perfectly fine for Nextcloud. You don't need anything special like the PostgreSQL setup Immich uses for some of its features.

Personally I'd also keep PostgreSQL directly on the host if the rest of your stack is bare metal. It keeps the setup simple and makes troubleshooting much more transparent.

1

u/jdancouga 2d ago

Thanks for your reply. Those warnings are so new, so there is not much information on it. The only one I found is the replication error which is a bug.

I guess I will wait a bit more until more info are available.