I was forced to make a new installation due to a broken previous server installation. Now, I have a new server and wanted to use my old data and settings from my previous Nextcloud.
My problem: I only could rescue the files from the …/data and the /var/lib/mysql directory. So, how to use the old MariaDB files to be able to setup a new Nextcloud with the old DB?
I read a lot of posts but was not able to solve it.
Here some details about my system:
Raspberry Pi 3
Debian GNU/Linux 12 (bookworm) aarch64
Nextcloud 29
MariaDB 10
The main thing I’ve tried: Copying old nextcloud DB into new directory inclusive the old ibdata1 file → possible to see the database via mysql, not possible to use it for an nextcloud installation
Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1932 Table 'nextcloud.oc_appconfig' doesn't exist in engine
when doing mysqlcheck it shows for each table
nextcloud.oc_example_table
Error : Table 'nextcloud.oc_example_table' doesn't exist in engine
status : Operation failed
Are you replacing the entire contents of /var/lib/mysql on your target server with the backed up content of /var/lib/mysql from the old server? Or are you trying to do it piecemeal (i.e. just the nextcloud/ folder)?
Ideally you swap out the entire /var/lib/mysql (and have somewhat similar db versions in place).
(Also, hopefully you’re stopping MariaDB while doing these activities.)
Well, ideally, you do neither of these things and restore from a real db backup, but sounds like that’s not an option.
unfortunately there was no option to do a real backup.
I also thought about to replace the whole directory, but was not sure about that, due to I only could install MariaDB version 10.11 and I suppose the old DB was 10.5 or 10.6…
So I will try this. Please tell me, which command you recommend to stop MariaDB safely.