Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer Files to Another User When They Leave the Instance (or company) #19154

Closed
MTRichards opened this issue Sep 18, 2015 · 30 comments
Closed
Assignees
Labels
blue-ticket enhancement overview p2-high Escalation, on top of current planning, release blocker
Milestone

Comments

@MTRichards
Copy link
Contributor

Transfer Files after departure – As an admin, I want to be able to log in to ownCloud and transfer a user’s files from one account to another so that files (shared and not shared) are not lost when a user is deleted
Acceptance Criteria:

  • Admin can log in and select a user in the user management panel
  • Admin can select a new option “transfer files” This brings up a popover menu (or page) that described the user’s files:
    • Total number and size of files owned by the user
    • Total number and size of files shared by the user
    • Total number and size of files received by the user
  • Admin can select a checkox and choose “transfer files to” and/or “transfer shares to” – admin can perform a type ahead filter search of a user on the system
  • Admin selects the user and a button says initiate transfer “Depending on the number of files, this may take some time”
  • A visual feedback shows that this operation is taking place
  • The files are moved into a new root files directory for the recipient of the transfer labeled with a folder showing the username of the files. File cache entries are updated, and all existing share recipients are retained with no change, except the ownership now says “shared by the new user”
  • At no time can the admin actually see the files, just the summary and initiating the tranfer
  • Complete logging of the file inspection and transfer is recorded
  • If the operation fails to complete, the admin gets a warning.
@MTRichards MTRichards added this to the 9.0-next milestone Sep 18, 2015
@PVince81
Copy link
Contributor

and also make sure this runs in a background job, not as a single PHP request which might time out...

@oparoz
Copy link
Contributor

oparoz commented Sep 18, 2015

What about files shared with the user? What happens to that?

@godspeed20
Copy link

I have a similar need so will add in here. @oparoz I don't think files shared with that person matter, it's more about making sure files owned or shared from that person are not lost and can be taken over by the new owner.

I also think this issue is pretty similar to #13355 so they might end up being linked

@oparoz
Copy link
Contributor

oparoz commented Sep 19, 2015

@godspeed20 - Well that user will have to write down the list of all shares and contact all people so that he can add the shares again. Not a great experience.

@godspeed20
Copy link

@oparoz do you mean the person who is being deleted? Maybe my use case is different to the OP but my concern is solely around losing owned files, not files shared to the departing owner. If someone else takes over a project I'd like them to take over ownership too, so if the leaving person just leaves the new person has to get access to their files, download them all, get the old user removed, then create a new folder, re-share all the data, re-add all the people who had access to it before (minus the person who left) and then continue. That seems like a pretty bad process, worse than what you've mentioned.

Ideally on a shared item basis (file or folder) the user or admin can simply migrate it to another user, keeping all shares of that particular shared item as is. This would only apply to items they own - anything shared to the departing owner are the responsibility of whoever shared that item to start with so that's a different person's issue to resolve (and you'd hope the group share would ideally take care of that anyway most of the time). does that make sense?

Hmm actually now I think of it I see where you were coming from, think I'm thinking of a different use case, you're point stands for this particular case, sorry...

@MTRichards
Copy link
Contributor Author

Files shared from definitely matter, shared to... Can go either way, which is why I would add it and let the situation decide.

Matt Richards
VP Products & Markets
ownCloud, inc.

On Sep 19, 2015, at 8:21 AM, godspeed20 notifications@github.com wrote:

I have a similar need so will add in here. @oparoz I don't think files shared with that person matter, it's more about making sure files owned or shared from that person are not lost and can be taken over by the new owner.

I also think this issue is pretty similar to #13355 so they might end up being linked


Reply to this email directly or view it on GitHub.

@DeepDiver1975
Copy link
Member

@schiesbn what do we need to take care of in case of encryption being enabled?

Is is possible at all?

@MTRichards can we exclude encryption from this operation?

Worst case the admin has to decrypt the users files first, move them to the new user and encrypt them as the final step

@MTRichards
Copy link
Contributor Author

If we do this in two steps, first without encryption and then later with (if the recover key is enabled) I think that would be ok. Also it could take a very long time to make such a migration with encryption enabled, which is natural based on the situation.

@DeepDiver1975
Copy link
Member

as discussed with @MTRichards For the scope of 9.0 we will implement this as an occ command

./occ files:transfer-ownership user1 user2

@DeepDiver1975 DeepDiver1975 self-assigned this Nov 17, 2015
@PVince81
Copy link
Contributor

  • should the target user name be the user id (ugly LDAP is sometimes) or display name ?
  • corner case: what if the target folder already exists ? make sure to append "(2)" maybe

@DeepDiver1975
Copy link
Member

We should go for the user id - even if the LDAP guid is ugly - better be save then sorry.

@DeepDiver1975
Copy link
Member

corner case: what if the target folder already exists ? make sure to append "(2)" maybe

@MTRichards I'd create a target folder where all files will be moved in

@DeepDiver1975
Copy link
Member

The command will be resumable 'just' because of files and folders are moved.

@DeepDiver1975
Copy link
Member

@MTRichards what will happen to user mounts? I'd prefer to ignore them - objections?

@PVince81
Copy link
Contributor

@DeepDiver1975 I think it was already agreed that there will be a target folder:

the files are moved into a new root files directory for the recipient of the transfer labeled with a folder showing the username of the files

@DeepDiver1975
Copy link
Member

  • move files in trashbin?
  • move files versions?

@PVince81
Copy link
Contributor

Depending on how the move is performance, if you do it with a View and the hooks are fired properly, it should also automatically move the versions.

Trashbin might be more tricky. Would probably also need a special folder in the target user's trashbin also with the generated folder name and move everything there. Note that trashbin can also have trashed versions...

@PVince81
Copy link
Contributor

  • what about received shares ? I guess those would be ignored ? (these are like mount points)
  • what about reshares ? if the original user was receiving a share and then reshares with another user

@MTRichards
Copy link
Contributor Author

User mounts can be removed because they are not managed directly by ownCloud and won't disappear when a user is deleted (the file server may still have copies).

Received shares can go away in version 1.
Reshares can go away too, as the file is still owned by someone else.

The key is to make sure no files are lost .

AND

(update) to make sure that files that are shared by the person who is being removed are still shared so work can continue, and the files don't get lost.

Plus, reshares are going to collapse into showing up as a share in the original list anyway.

@MTRichards
Copy link
Contributor Author

We could, conceivably, not move trashbin for now...the majority of the files in this use case should be in the main folders and versions so we could leave trash and just remove it.

@MTRichards
Copy link
Contributor Author

@MTRichards I'd create a target folder where all files will be moved in

Agreed. I like this a lot, where the folder is the original owner's username or display name

@PVince81
Copy link
Contributor

PVince81 commented Feb 4, 2016

@PVince81
Copy link
Contributor

Implementation is done, closing.

@DeepDiver1975 if there are follow ups / improvement ideas please raise separate tickets for them.

@octacian
Copy link

This is really great to see. Found it pretty useful, however, what if you wanted to migrate the data completely from one user to another overwriting the data of the second. An option to not delete the original files from the original user would be great too.

Somehow I couldn't get the files in the transferred folder into the new user's main folder, overwriting default ownCloud data. Since this didn't work, I had to do it the hard way which was uploading the data manually from my computer.

@derkostka
Copy link
Contributor

derkostka commented Jun 19, 2016

This is a very good Feature. One question: are contacts and calendar entries also copied ?

I was always searching for a possibility to "rename" a user, this function seems to be able to do it, now.

@DeepDiver1975
Copy link
Member

One question: are contacts and calendar entries also copied ?

no - this is pure transfer of files.

Transferring calendars and contacts could be done via a simple update of database entries.
But this is rather critical since all connected caldav and carddav clients need to reconnect using a different url.

@octacian
Copy link

How can data be transfered to the new user's home folder overwriting default ownCloud data? What about just copying data rather than moving?

@PVince81
Copy link
Contributor

Ticket for transferring versions: #29540

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blue-ticket enhancement overview p2-high Escalation, on top of current planning, release blocker
Projects
None yet
Development

No branches or pull requests

8 participants