I want to rebuild NC

My NC seems to have some faults and I wanted to rebuild my NC from the beginning. However, I would like to migrate the data(/Nextcloud/data) and user configuration to the rebuilt NC.
I would ideally like to restore the data sharing status as well. This is indeed not possible.

Does NC provide a way to migrate data and user configurations?


Nextcloud 23.0.2, MariaDB 10.2.41

Yes. Install the same version (23.0.2) and use backup (old server) and restore (new server).

If possible stop only your old server and install the new Nextcloud on a new (virtual) hardware.

Think also about the migration of the web server and the SSL certificates. This should be the first part of your migration.

This is stored in the database e.g. MariaDB. backup/restore must include your database.

It’s worth a try, but depending on the troubles the thread opener is facing in his actual Nextcloud instance, there I tend to grade a full backup restore approach as risky because you can this way reimport the failures… Just as cautionary tale.

A very easy shortcut I think:

  1. Install a new NC source.
  2. Make initial settings for NC.
  3. Configure the user.
    – The user name must exactly match the designation in the old NC.
  4. Move the Data directory of the old NC to the new NC.
  5. Run occ scan:files --all

This would at least restore the relationship between the user and the data directory. The problem is the data of each user’s user itself. How to port them?

So the big concern would be the database.

The problem I’m having (At least this is the only problem I want to solve):

  1. Unable to enable/disable the default encryption module in the WEB UI.
  2. For some users, there is a problem that a folder may already exist even though it is the first folder to be created.
    ex) If the user tries to create a folder named “ABC” for the first time, a folder named “ABC (2)” will be created.

It is believed that the DB manages these.
User and Data directory combinations can be restored. Should I be satisfied with this and give up on the others?

  1. to 5.: yes that is correct

Unable to enable/disable the default encryption module in the WEB UI.

Do you use server side encryption? That is only useful if you use external storage at a second hoster. If not it is no security advantage. Perhaps you can deactivate encryption. Watch this video.

For some users, there is a problem that a folder may already exist even though it is the first folder to be created.

I think it would be better to create a first (admin) user with new name and after restore database and restore data hopefully this user has been gone and all is fine.

It is believed that the DB manages these.

Hopefully. Use a test system to test it out. If all works you can re-move this installation to your old hardware.

User and Data directory combinations can be restored. Should I be satisfied with this and give up on the others?

I think there is no really difference. Backup all under e.g. /data and restore selective /data/username and perhaps some other directorys until it works.

Perhaps we also can solve the old problems. Then you can use your old installation. :wink:

Do you use server side encryption? That is only useful if you use external storage at a second hoster. If not it is no security advantage. Perhaps you can deactivate encryption. Watch this video.

I have not enabled server-side encryption because I had trouble in the early days of using NC and was afraid of having trouble encrypting and not being able to decrypt.

I think it would be better to create a first (admin) user with new name and after restore database and restore data hopefully this user has been gone and all is fine.

Are you saying that the initial user (administrator) name is intentionally different?

Can you explain it? If it is not server-side-encryption what is it?

I think you can use every username e.g. “admin”. But with restore i also think the old username/password is anyway overwritten.

Can you explain it? If it is not server-side-encryption what is it?

The trouble I had was not related to encryption. I started using it with NC9 and for some reason had problems with it not recognizing files. I then abandoned that NC altogether and rebuilt a completely new NC, which continues to this day. I’m sensibly afraid of encryption and can’t enable it.

Personally, I would open two new threads and try to solve the underlying problems of your current Nextcloud instance, or at least identify their root cause, because IMHO that is the only way to properly define/assess how to proceed in this case.