Symptoms
When running a migration to a SharePoint Online environment, you receive a variation of this message:
The page could not be created. Custom Scripting might be deactivated on the destination site or you might not have sufficient permissions.
Index
Error Code
IN803-002
Details
To migrate ASPX pages to a modern site, custom scripts must be allowed in the destination site collection.
Without SharePoint admin or Global admin permissions, the Custom Script feature cannot be activated automatically during a migration to a modern site. Because of this, ShareGate Migrate is not able to migrate your forms, web parts, and ASPX pages.
For more information on custom script see the Microsoft article Allow or prevent custom script.
Note: Custom Script is disabled in a modern site when it is created in SharePoint, even if you have it enabled at the tenant level.
Solutions
Use SharePoint admin or Global admin permissions
If you use SharePoint admin or Global admin permissions, the app will be able to activate custom script automatically during the migration.
If you have site collection admin permissions, you can ask a SharePoint admin or global admin to activate custom script on your site collection manually with the steps below.
Activate custom script manually in Microsoft 365
To activate custom script in a Microsoft 365 site collection with PowerShell, follow these steps:
Download the SharePoint Online Management Shell.
Open a SharePoint Online Management Shell prompt.
Run the two following commands:
Connect-SPOService -Url https://YourDomain-admin.sharepoint.com Set-SPOSite -Identity https://YourDomain.sharepoint.com/sites/YourSite -DenyAddAndCustomizePages 0
Run your migration again, and everything should be working properly.
Note: It is recommended to set Custom Script back to denied after the migration. To do so, you can run the script again, but this time change the -DenyAddAndCustomizePages value to "1".
Activate custom script manually in SharePoint 2019
To activate custom script in a SharePoint 2019 site collection with PowerShell, follow these steps:
Open a Windows PowerShell or Windows PowerShell ISE window.
Run the following script on your Site Collection:
$site = Get-SPSite -Identity "http://yourfarm/sites/yoursite"$site.DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask\
Run your migration again, and everything should be working properly.