How to clone profile with files

Hi there,

Is it possible to clone a profile with their files? How?

Thanks a lot!

No, not directly. There is the skeleton-directory where you can specify the default files for all new users.

Workaround: You can create a new user, then put server in maintenance mode, copy files manually, turn off maintenance mode and run sudo -u www-data php /path/to/nextcloud/occ files:scan username to scan the user’s directory to update the database file index.

1 Like

Perhaps there is also a way to copy the user related database entries about access rights/shares, personal settings and other apps related stuff. But would need investigation.

1 Like

correct me if i´m wrong, but i dont think Mainenance Mode ist neccessary here,…

but yeah @jask , thats the way to go. Bild a script around it, you can create users with occ

1 Like

Great!! Tomorrow I will try it.

Thanks a lot!

Probably not. You could have shares and when someone changes files in the share while you copy files around this could cause problems.

HI there,

I did it and was fine! I did not need to enable maintenance mode. It was really fast.

Thanks a lot :slight_smile:

1 Like