dsccommunity / dsccommunity/SharePointDsc
SPSearchServiceApp is Creating a New SA Even with Existing DB
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 246
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring
Trying to restore the search service application from existing database. For example, in DR recovery scenario or blue-green deployments or stage infrastructure or for v2v upgrade scenarios.
Verbose logs showing the problem
Current version of the SharePointDsc module is using New-SPEnterpriseSearchServiceApplication, whereas when we need to restore a search service application from existing administration database, we need to use Restore-SPEnterpriseSearchServiceApplication commandlet.
Suggested solution to the issue
Check if the administration database already exists in the SQL instance and run either New-SPEnterpriseSearchServiceApplication or Restore-SPEnterpriseSearchServiceApplication depending on the condition.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# just an example,
SPSearchServiceApp SearchServiceApp
{
DatabaseName = "Search_Service_Application_DB_b183238874e14d7dad0aed1941f80308"
ApplicationPool = "SharePoint Search App Pool"
ProxyName = "Search Service Application"
Name = "Search Service Application"
DefaultContentAccessAccount = $SPSearchCrawlAccountCredential
Ensure = "Present"
PsDscRunAsCredential = $SPInstallAccountCredential
DependsOn = "[Script]SearchServiceApp"
}
The operating system the target node is running
Version of SharePoint that is used (e.g. SharePoint 2016)
Version and build of PowerShell the target node is running
Version of the DSC module that was used
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SPSearchServiceApp resource entry point and trace how DatabaseName is handled when ensuring the service application. Compare the existing-database scenario with the New-SPEnterpriseSearchServiceApplication and Restore-SPEnterpriseSearchServiceApplication cmdlets. Done means the resource selects the appropriate cmdlet based on whether the administration database already exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100