Reinit postgres data base

Nextcloud version : 20.0.4.0
Operating system and version : Arch Linux, kernel 5.9.14
nginx version : 1.18.0-2
PHP version : 7.4.13
PostgreSQL version : 13.1-3

I somehow messed up my data base and I do not think i can save it. That’s why I would like to setup a fresh data base.

After repeating the steps in


several times and putting the proper credentials into the config/config.php Nexcloud won’t start and continues showing .

The log file shows:

log file
{"reqId":"dZo6yTVSUdnEk5ScxpVv","level":3,"time":"December 26, 2020 20:52:48","remoteAddr":"92.211.14.221","user":"--","app":"index","method":"GET","url":"/","message":{"Exception":"Doctrine\\DBAL\\Exception\\TableNotFoundException","Message":"An exception occurred while executing 'SELECT * FROM \"oc_appconfig\"':\n\nSQLSTATE[42P01]: Undefined table: 7 FEHLER:  Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT
* FROM \"oc_appconfig\"\n                      ^","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","line":169,"function":"convertException","class":"Doctrine\\DBAL\\Driver\\AbstractPostgreSQLDriver","type":"->","args":["An exception occurred while executing 'SELECT * FROM \"oc_appconfig\"':\n\nSQLSTATE[42P01]: Undefined table: 7 FEHLER:  Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT * FROM \"oc_appconfig\"\n
    ^",{"errorInfo":["42P01",7,"FEHLER:  Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT * FROM \"oc_appconfig\"\n                      ^"],"__class__":"Doctrine\\DBAL\\Driver\\PDOException"}]},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php","line":149,"function":"wrapException","class":"Doctrine\\DBAL\\DBALException","type":"::","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDOPgSql\\Driver"},{"errorInfo":["42P01",7,"FEHLER:  Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT * FROM \"oc_appconfig\"\n
          ^"],"__class__":"Doctrine\\DBAL\\Driver\\PDOException"},"An exception occurred while executing 'SELECT * FROM \"oc_appconfig\"':\n\nSQLSTATE[42P01]: Undefined table: 7 FEHLER:  Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT * FROM \"oc_appconfig\"\n                      ^"]},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":914,"function":"driverExceptionDuringQuery","class":"Doctrine\\DBAL\\DBALException","type":"::","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDOPgSql\\Driver"},{"errorInfo":["42P01",7,"FEHLER:
Relation \u00bboc_appconfig\u00ab existiert nicht\nLINE 1: SELECT * FROM \"oc_appconfig\"\n                      ^"],"__class__":"Doctrine\\DBAL\\Driver\\PDOException"},"SELECT * FROM \"oc_appconfig\"",[]]},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","line":202,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT * FROM \"oc_appconfig\"",[],[],null]},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":206,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT * FROM \"oc_appconfig\"",[],[]]},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":217,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":345,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":110,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":301,"function":"getApps","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":949,"function":"getValues","class":"OC\\AppConfig","type":"->","args":[false,"installed_version"]},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":668,"function":"getAppVersions","class":"OC_App","type":"::","args":[]},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":155,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters
replaced ***"]},{"file":"/usr/share/webapps/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\AppFramework\\Utility\\{closure}",...

How do I “re-setup” a data base such that nextcloud won’t complain? And how to take care of all the files of the nextcloud’s users?

Hello yfw,

are you sure, the only thing you changed is the database software? (Same user data? same data in the database instance (dump out - dump in)?, same HTML?).

I’am ask, because the error log says: “Relation exisitiert nicht” … file: …3rdparty/pimple/…

I think, if the only think you changed is the database system software, this error can not be happend.
In the log before you can find: TableNotFoundException - which means that somthing goes wrong with the database data. In the export process or import process , I can’t see it from here.

Hopefully I could give you the right direction.

bye.