Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPSearchServiceApp is Creating a New SA Even with Existing DB #1233

Open
shurick81 opened this issue Aug 24, 2020 · 4 comments
Open

SPSearchServiceApp is Creating a New SA Even with Existing DB #1233

shurick81 opened this issue Aug 24, 2020 · 4 comments
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@shurick81
Copy link

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

@ykuijs ykuijs added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Sep 5, 2020
@ykuijs
Copy link
Member

ykuijs commented Sep 5, 2020

Good point. SPFarm is using some code to check if the ConfigDB exists. We can reused that code here.

@ykuijs
Copy link
Member

ykuijs commented Sep 8, 2020

@ykuijs
Copy link
Member

ykuijs commented Sep 8, 2020

Hi @shurick81, I have been investigating this change some more. What is the exact scenario you are trying to accomplish?

The documentation for the Restore cmdlet, I see this:

The first set of parameters is for Application Configuration Attach mode and the second set of parameters is for Search Application Attach mode.

Application Configuration Attach mode only restores configuration data that is stored in the administration database. However, Search Application Attach restores configuration, topology and all crawled data.

Which scenario are you looking for?

@shurick81
Copy link
Author

shurick81 commented Sep 9, 2020

Let me put it like this. I have a Disaster Recovery farm precreated. Then when necessary, I want to restore the copy of the administration database from production to the SQL instance of the DR farm and then run a DSC configuration that will attach it.

According to my test, using New-SPEnterpriseSearchServiceApplication results in missing all my custom content sources in the service application. So I concluded that entire restored database was replaced with a fresh, empty database.

Application Configuration Attach is the set I'm using now in PowerShell for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants