In this post, we are gonna solve “Failed to find Project Site object. Are there any database mounted” issue that you may encounter when enabling the SharePoint PWA feature in Project Server 2016 and 2019.
Enable-SPFeature Failed to find Project Site object
In Project Server 2016, we have tried to enable the PWA feature using PowerShell on a new created site collection by doing the following:
- Open SharePoint 2016 Management Shell as Administrator.
- Run the below command line to enable PWA feature.
Enable-SPFeature pwasite -URL "PWA Site Collection URL"
But the “Enable-SPFeature” cmdlet faild, and we got the below error:
Enable-SPFeature : Failed to find Project Site object. Are there any database mounted?
At line:1 char:1Enable-SPFeature pwasite -URL http://epm:19812/sites/melqassas CategoryInfo : InvalidData: (Microsoft.Share…etEn ableFeature:SPCmdletEnableFeature) [Enable-SPFeature], SPExcep tion FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCm dletEnableFeature
Failed to find Project Site object. Are there any database mounted
This issue usually occurs if you have tried to enable the PWA feature on a site collection without a Project Web App template. So that, before enabling the PWA feature on a specific site collection, you must make sure that the root site template is set to Project Web App Template “pwa#0“.
Get Current Site Collection Template using PowerShell
Here, we’ll check the current site template to make sure that it has Project Web App Template “pwa#0” before running the Enable-SPFeature cmdlet.
Steps
- Open SharePoint 2016 Management Shell as Administrator.
- Run the below command line to check which SharePoint Site Template is using for a specific site.
(Get-SPWeb "SharePoint Site URL").WebTemplate
In our case, the current site template is “STS” that refers to a Team Site Template, not a Project Web App Template “pwa#0“.
You might also like to read Get SharePoint Site Template PowerShell
Therefore, we’ll not be able to activate the PWA feature on a site collection with a SharePoint Team site template, it must have a PWA template. this is actually, the root cause of this error “Failed to find Project Site object. Are there any database mounted?“
So the important question is Can we change the SharePoint site template from Team site template to PWA site template? This is what will be answered in the next section!
Unfortunately, we can’t update or change the SharePoint site template for a site that already created and its template applied! In this case, to change the site template, the site must be deleted and recreated in order to apply a different template. Read more at Change site template SharePoint 2016 PowerShell.
Here, we’re assuming you just have created this site with a wrong template, so it’s a new site and there is no issue to delete it as the following:
- Open SharePoint 2016 Management Shell as Administrator.
- Run the below command line to remove SharePoint Site collection.
Remove-SPSite -Identity "Site Collection URL"
Create Project Web App Instance using PowerShell
After deleting the old site collection, we’ll create a new Project Web App Site Collection by doing the following:
- Open SharePoint 2016 Management Shell as Administrator.
- Run the below command line to create a new PWA instance.
New-SPSite -ContentDatabase "Content Database Name" -URL "Site Collection URL" -Template pwa#0 -OwnerAlias "domain\account"
- Wait a moment until the cmdlet executed successfully, it may take some time to finish.
- Great, the new PWA Site Collection has been created properly. but If you tried to browse it without enabling the PWA feature, you will get this error No Project web app instances found. Create at least one PWA instance before accessing this page.
Enable Project Web App Feature using PowerShell
To avoid, the above error, you should enable the PWA feature for the newly created instance as the following:
- Open SharePoint 2016 Management Shell as Administrator.
- Run the below cmdlet to enable the PWA feature for the Site collection with a Project Web App template.
Enable-SPFeature pwasite -URL "PWA Site Collection URL"
- The Project Web App feature should be enabled now, and the “Failed to find Project Site object. Are there any database mounted?” error is gone!
You might also like to read Install and Configure Project Server 2016 step by step.
Conclusion
In conclusion, we have learned how to Enable Project Web App Feature using PowerShell correctly to avoid the “Enable-SPFeature: Failed to find Project Site object. Are there any database mounted?” issue.
We have also learned how to check the current SharePoint site template is using. Moreover, we confirmed that we can’t change the SharePoint Site template to another template and the only available option is recreating the site again with your preferred template.
Applies To
- Project Server 2019.
- Project Server 2016.
You might also like to read
- Migrate to Project Server 2016 Step By Step.
- Missing Site Creation Settings in Project Server 2016.
- Missing Alerts and Reminders Project Server 2016.
- What’s new and deprecated in Project Server 2016?
Have a Question?
If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.