Hi Noah, great solution, untill now it seems to be working.
However, when i tried to synchronize recursive folders i found out that the permission to the root folder was deleted, it was not possible to click the sync. butten.
I ran these small queryes to get access to the root dir and then i could build all the necessary permissions for every directory.
"Create a root folder"
insert into Folders
([PortalID],[FolderPath],[StorageLocation],[IsProtected],[IsCached],[LastUpdated],[CreatedByUserID],[CreatedOnDate])
select #YourPortalID#, '',0, 1, 0,GETDATE(),1,GETDATE()
"Get the new FolderID you just created"
SELECT [FolderID],[PortalID],[FolderPath] FROM [DotNetNuke].[dbo].[Folders] WHERE [PortalID] = #YourPortalID#
"Create permission for the new root folder"
insert into FolderPermission
(FolderID,PermissionID,AllowAccess,RoleID,UserID,CreatedByUserID,CreatedOnDate,LastModifiedByUserID,LastModifiedOnDate)
select #NewFolderID#, 5 ,1, 0 ,NULL,1,GETDATE(),1,GETDATE()
Now you have access to run the Sync. :-)