NextCloud 19.0.3 - Transfer Config/DB/Data to new Server

Hallo Community,
ich bin mit Nextcloud sehr zufrieden, habe Nextcloud 19.0.3 unter FreeBSD 12.2 installiert. Jetzt ist mir das Nextcloud System kaputt gegangen und ich kann das System nicht mehr starten ein OS Backtup ist leider auch nicht vorhanden :unamused:
Die Verzeichnisse

  • nextcloud/config
  • nextcloud/data
  • var/db
    wurden per NFS in das System gemountet und sind damit noch vorhanden.

Wenn ich ein neues NextCloud 19.0.3 System aufsetze, dann klappt es nicht mehr die auf dem NFS liegenden Daten sauber die Cloud einzubinden. Ich erhalte immer “Interner Server Fehler” als Fehlermeldung.

Gibt es eine Möglichkeit die Datenbank, die abgelegten Daten, Termine und Kontakte wieder zu recovern ?

Hello Community,
i am very contended with Nextcloud, have Nextcloud 19.0.3 installed on FreeBSD 12.2 Now the Nextcloud system is broken and I can’t boot the system anymore. Unfortunately an OS backup is not available :unamused:
The directories


were mounted via NFS into the system and are therefore still available.

When I set up a new NextCloud 19.0.3 system, it doesn’t work anymore if the data on the NFS is mounted cleanly into the cloud. I always get “Internal Server Error” as error message.

Is there a possibility to recover the database, the stored data, appointments and contacts ?

Dank & Gruß / Thanks and regards

please look into the nextcloud log - more info will be there.

Hi Joerg,
the following message in my LOG is a bit confused for myself.

“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user ‘admin’@‘localhost’ (using password: YES)”

User admin and th password is configured at the new system like at the old system.

root@localhost [(none)]> SHOW DATABASES;


| Database |
| information_schema |
| mysql |
| nextcloud |
| performance_schema |

database is in the view, but not sure if a change of var/db can bring the system in an inconsistent operation ? :thinking:


Update :roll_eyes:
the database ist shown, but is empty :thinking:
the frm and ibd files are mounted in the folder /var/db/nextcloud +
how to import this in the db nextcloud ? any simple command existing ?

i’m happy for any, helping reply

Final Update.
i’ve invested about 1 day to get the IBD and FRM Files back in a usable SQL Format with all informations until the system crashed.

Minimum Requirement
the following, complete folder from the crashed system (best case, they are mounted by NFS).

  • var/db/mysql
  • /usr/local/www/nextcloud/data

Install a fresh VM with MariaDB/PostgreSQL and import a copy of mysql folder into the VM.
secure the MariaDB Server, install PHP7.4.x and myphpadmin also on this server.
if all is configured, you see the existing databases in phpmyadmin.
Now rname mysql to mysql.whatever and mount your mysql folder to /var/db/mysql to replace all mysql folder with the database from nextcloud. after reconnecting to phpmyadmin you should see the nextcloud database from the crashed system and it should be browsable. If it’s browsable, export the nextcloud database to a SQL File and download this to your computer first.

New Server
Connect to your new server and upload the SQL file to the server first.
Connect to Database via mysql -u root -p and login with your credentials.
Create a fresh nextcloud database (lie in a new installation)
Import the sql file into the fresh database “nextcloud” - that should proceed without any error.

Rename the nextcloud/data folder to nextcloud/data.whatever
Mount your existing data folder trough NFS to /usr/local/www/nextcloud/data to recover the last status of this folder.

the nextclous/config folder is a bit tricky, cause an issue in the folder can bring “internal error messages” ub and the log entry is not realy informativ to fix this issue.
leave the config folder as is and start the initial configuration on the new server. enter admin and dbadmin as configured as described in your broken system and you get reconnected to your nextcloud and all stored data, calender and contacts :grinning:


1 Like