Migrating data from old to new System

Hello guys,

i am currently migrating my data from an old Nextcloud server to a completely fresh install.
I already sucessfully copied my files and let occ rescan the user files without problems. But now the users cant upload or edit those migrated files. I guess there is something like a write protection on them. The Upload Button dissapeared, instead there is the message “You dont have permission to upload or create files here”.

Hope you can help me to solve this.

Best regards

Hi Skankhunt,

Everything, from folders to files, is owned by anyone else than Nextcloud’s local ID. If your Nextcloud is running as user www, then that user must be the owner of everything. If it is running as www-data, then that is the account you must set as owner of everything.

Should be pretty easy to fix…

1 Like

Here is what the ownership looks like on the old working system:

-rwxrwxrwx 1 www-data www-data 

And thats what the ownership on the new system for the same files look like:

-rwxrwxrwx 1 www-data www-data

Then it just means your new server is not running as www-data anymore and is using whatever else…

How am i able to find that out?

Well… Seems to use www-data.

but with 777 it doesn’t matter.

@Skankhunt42 your os version? your web server? which how to did you follow? centos with selinux?

Its Ubuntu Server 20.04 LTS - Apache2 Web Server.

I followed the File Operations guide for occ to copy and reindex my files --> https://docs.nextcloud.com/server/9.0/admin_manual/configuration_server/occ_command.html#file-operations-label

Thanks for your tips and help.

I could finally fix the problem by changing the ownership to root before copying the files to the new system and giving www-data the ownership again on the new installation.

Best regards

Know that in Unix, users and groups are not identified by their name but their number. Both instances have been using the same name but it looks like they mapped it to different numbers. By forcing ownership back to www-data on the second system, it forced it to the number used by that one. Also, should you have forget about the root directory in your first migration, re-doing it forced it back to the proper owner.

Glad that you got your setup fixed,

I already thought about that and checked the UIDs on both systems it was 33. I also tried to define the ownage with UID but still didnt Work.

Thank you for your help.

(Und jetzt ist aber Schlafenszeit :slight_smile: )