Hello Radek,
I have not worked on this, but I assume you will first have to migrate all the Opportunities that you want to link and then set the relationship (relate documents) using this migration. So this might indeed require already existing documents which would be linked with this migration.
Regards,
Chandan