Add attachments from a folder to a existing features in a hosted feature layer. For this to work properly it is assumed the attachments are coming from a replica FGDB. The attachments are saved to a folder using the method recommended here: How To: Batch export attachments from a feature class
Alter that script to rename the attachments using the GlobalID in the naming convention.
From there you can run the notebook in jupyter by pointing to the appropriate feature layer ID and folder where you saved your attachments.