just wanted to post the solution Ross and I came up after our debuggin session
The problem is, that even as it looks like a folderstructure like on any other os, it's not. And even that you know this fact you sometimes forget it works in a different way
so the sollution for this problem was simple, change the order of the commands. You first need to move all files and than create the copy.
It then moves all files it can move and also creates the folder structure, after that you simply copy all the remaining files you are not the owner. You don't have to worry about duplicates, as there are none.
here are my two commands:
## 1st - MOVE ##
gam user <user_email> \
move drivefile <source_file_ID> \
newfilename "<DriveFileName> \
teamdriveparentid <target_shareddrive_ID> \
duplicatefiles overwriteall \
createshortcutsfornonmovablefiles false \
mergewithparentretain false \
duplicatefolders merge \
copymergedtopfolderpermissions false \
copymergedsubfolderpermissions false \
copytopfoldernoninheritedpermissions never \
copysubfoldernoninheritedpermissions never \
retainsourcefolders true \
summary
## 2nd - COPY ##
gam user <user_email> \
copy drivefile <source_file_ID> \
teamdriveparentid <target_shareddrive_ID> \
teamdriveparentname <DriveFileName> \ # the newfilename you set in the move command
mergewithparent true \
recursive \
duplicatefolders merge \
copyfilepermissions false \
copymergewithparentfolderpermissions false \
copymergedsubfolderpermissions false \
copytopfolderinheritedpermissions false \
copysubfolderinheritedpermissions false \
copytopfoldernoninheritedpermissions never \
copysubfoldernoninheritedpermissions never \
summary
FYI
In my initial question, I mentioned that the copies of my non-moveable files disapear in during the move command. We also looked into this behavior and they definitely were deleted during this run. Ross will have a look into this, as the files should not have been deleted, but the propper solution is the one above.
@Ross many thanks again for your time, it was a fun debugging sessaion!
Many thanks,
Tobias