When migrating to groups or publishing sites in Office 365, you receive this error message:
Copying to an Office 365 Site Collection requires Custom Scripts to be enabled at the destination. This setting will be modified prior to the migration.
If possible, run the migration as a Global Administrator.
If you cannot run your migration as a Global Administrator, you can manually enable custom scripts by following the instructions in this article.