Can I change from one postgresql database to another in the same cluster?

Nextcloud version (eg, 20.0.5): 21.04
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18
PHP version (eg, 7.4): 8.0
Postgresql 13.4

I plan to migrate an older nextcloud instance to a brand new server with a fresh install of all components, created in a reproducible manner with ansible.

My Idea is to creata a ‘provisional’ nextcloud instance with all apps and a special postgresql db, lets call ist ‘firstinstall’.

Then play around with the setup and if everything works, i would create a second postgresql db in the same cluster, restore the original database from the old server in it, copy the files in their places and switch the new nextcloud instance to this original database.

This last step I can’t get zo work.

occ db:convert-type

requires another type of database (as the name already suggests :wink:

occ config:system:set dbname --value xxxx
occ config:system:set dbuser --value yyyy
occ config:system:set dbpassword --value zzzz

fail with permission denied for table oc_appconfig
which makes sense because the whole configuration is inconsistent after the first statement.

Can this be done at all ?

Thanks for listening