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.
Run the migration as a Global Administrator so that no manual action is required on your part to enable custom scripts.
If you cannot run your migration as a Global Administrator, you must manually enable custom scripts by following the instructions in this article.