Forum Discussion
Andre Picard
Apr 18, 2018Copper Contributor
Workflow problem after restoring a site collection
Hello, I deleted an entire site collection (by mistake) and restored it with the "Restore-SPSite" powershell command and everything is fine except for my WorkFlows, they don't work anymore. At some p...
Eduardo Scricco
Apr 18, 2018Brass Contributor
Try the following command:
Register-SPWorkflowService –SPSite "https://siteurl" –WorkflowHostUri "https://workflowservername:port" –AllowOAuthHttp -force -scopename "nameofthescopeinworkflowmanager"
After that you might need to restart the workflows manually.
Andre Picard
Apr 18, 2018Copper Contributor
Already did that and restarted the services but still doesn't work. Don't forget workflows are working in my other sites collections I just have problem with a specific site collection that I had to restore.
Thanks.
- Andre PicardApr 20, 2018Copper Contributor
Now I know what happened but not sure how to fix it. It appears that my farm administrator account was not set as the site collection administrator and that what cause the problem. I have created a "test" site collection (with my normal user account set as the site collection admin) and added a simple workflow (workflow was working). I deleted the site collection and restored it with the "Restore-spsite" powershell command (using the farm admin account) and got an access denied error. Dispite this error the site collection has been restored but workflow are no longer working.
Is there a way to fix that?
- Andre PicardJun 15, 2018Copper ContributorI finally found a solution to this a while ago and decided to update this post in case someone has the same issue. This has nothing to do with my previous reply and I think this is a bug.
The final resolution is to manually fix the workflow database:
On SQL in database WKResourceManagementDB in table "Scopes" I had to fix the record for the site workflow scope. I found the error in the in the ULS log when I tried to run a workflow and discovered the site scope ID. Then in the scopes table I deleted the corresponding record and republished the workflow to recreate the record and workflow started working again. To find the corresponding record I looked at the Path field
"/Sharepoint/default/scopeID".