No users anymore after hardware-change

Unfortunately I had to change my hardware because my Odroid XU4 is only a 32-bit computer. Now it’s a Raspberry Pi 4B.

Before decommissioning the old server, I made a data backup and also a backup of the nextcloud and the databases.

On the new server I first left /var/www/nextcloud running in its original state so that I could update the files in /etc/apache2 /etc/php8.1 and others and of course also the config.php to the necessary status. (I also have websites on the server).

After successfully changing the files, I connected the hard drive with ncdata and websites and tested everything. So far OK, I was able to log in to the nextcloud with the user ‘ncp’.

Then I switched the nextcloud to maintenance mode=on, stopped Apache and mariadb and copied the backup of Nextcloud and database back again (with rsync -a). Then started mariadb, started Apache and set Nextcloud in maintenance mode=off.

nextcloud now starts in the browser with my start image, but only ‘ncp’ can log in, there is only this one user. When I try to add a pre-existing user, I get the error message “User cannot be created because there is already data for this user”. A database query from oc_users only returns this single user ‘ncp’.

Where could the users be hidden? Is there a way to create users? Have I forgotten something important?

Spielmops

I can’t speak to the specifics that are ncp related, but generally the suggested approach to migrate/restore a db is the one here: Restoring backup — Nextcloud latest Administration Manual latest documentation

It sounds like you have have mixed up your test db with your real one.

No, first I deleted all below ‘ncdatabases’ and then restored from old server.

Within the linked page are two ways ‘To restore MySQL:’. which one is good?

Spielmops

What I found:
in /path/to/ncdata I have 2 folders with the “firstname” ‘appdata_oc’ and the lastname ‘alphanumeric-characters’ with the lenght of 10 characters (eg. ‘appdata_ocrtd453htjs7’). In both of them is a folder with the name ‘identityproof’. One folder is from startdate of the new nextcloud and contains only one folder with the name ‘user-ncp’. The other one from 3 years ago contains folders for all my users.

So I suspect, that I have to initiate the older folder ‘appdata_octheolderone’ to get my users back. But how? Has anyone a clue?

In config.php there is this line:
‘instanceid’ => ‘theolderone’,

I’m completely at a loss

Spielmops

If you’re referring to the UTF8/multibyte support: Yes, use the UTF8 one.

My main point is that you can’t just copy MariaDB database files around and expect it to work. You have to a mysqldump (export) then a mysql import to avoid issues with different versions, architectures, etc.

So I suspect, that I have to initiate the older folder ‘appdata_octheolderone’ to get my users back. But how? Has anyone a clue?

Unfortunately it sounds like you went about this the hard way. There is a fully documented and working procedure for migrating to a new server: Migrating to a different server — Nextcloud latest Administration Manual latest documentation

Ideally you boot up your old server and follow the migration process.