This from Solution ID 200945830:
"When attaching a Media Object a record is always inserted into the F00165 table which stores the logical link between the EnterpriseOne record and the physical Media Object file. When attaching a record using a preexisting queue, in order to resolve the file attachment, the EnterpriseOne software uses a combination of the queue name and file name using the fields F00165.GDQUNAM and F00165.GDGTFILNAM respectively. When attaching a record using the File button, the EnterpriseOne software stores the full path to the local file in the field F00165.GDGTFILNAM to resolve the link.
Consequently files that are stored in the "central" Media Object Queues defined in P98MOQUE (typically on the deployment server) are accessible to all end users, whereas files that are stored and attached using the File button are only accessible to those users who have access to the local drive."
So, you should be able to preserve the relationship between the attachment and the master record by extracting these fields from the F00165 along with the table keys for that Media Object Queue. You'll have to chat with an SAP dude to figure out how to create the relationship inside SAP so that it links back to the stored files.