1

I am trying to restore the production farm Search Service Application to a pre-production farm.

This is to preserve all customisations to Search.

I have mounted a copy of each of the 4 databases (Admin, Links, Crawl, and Reporting) to a new SQL server instance.

When I try to run the following command :

$searchInstance = Get-SPEnterpriseSearchServiceInstance -local

$applicationPool = Get-SPServiceApplicationPool -Identity "PSP_SearchServiceApplicationPool"

Restore-SPEnterpriseSearchServiceApplication -Name "Search Service Application" -ApplicationPool $applicationPool -AdminSearchServiceInstance $searchInstance -DatabaseName "PSP_SearchAdmin" -DatabaseServer "SHAREPOINT_PREPROD"

I get the following error message :

Error 1

If I don't have the database attached, or I try a new DB name, I get the following error message :

Error 2

This seems like a catch-22 situation.

What am I doing wrong?

1

You have to create a new application pool for this to work.

You can export the topology and use it in the restore as follows.

# E.g. Export the current Search Topology from your Production farm as xml file
$ssa = Get-SPEnterpriseSearchServiceApplication
Export-SPEnterpriseSearchTopology -SearchApplication $ssa -Filename <FilePath\searchtopology.xml>

# Create a new application pool for your restored Search Service Application
$applicationPool = New-SPServiceApplicationPool -Name "SearchServiceApplicationPool" -Account "domain\username"
# or get an already existing application pool that you like to use:
# $applicationPool = Get-SPServiceApplicationPool -Identity <ApplicationPoolName>

# Restore the Search Service Application
Restore-SPEnterpriseSearchServiceApplication -Name <SearchServiceApplicationName>
-ApplicationPool $applicationPool
-TopologyFile <FilePath\searchtopology.xml>

SharePoint 2013 – Restore Search Service Application on different Server or Farm

  • Thanks for the reply. I have seen this resource, however it states (albeit commented out in your answer) that you can choose an existing application pool. In my case, the app pool was created for this purpose on a previous run of the script, so instead of deleting it every time I attempt to restore search, I just re-use it. Should I delete it instead? – Nullldata Jun 18 '18 at 19:52
  • You can reuse the pool. Just make sure it runs with the correct service-account and no unexpected other services are running in it. – MHeld Jun 19 '18 at 5:10
  • I get the same issue with a new application pool unfortunately. – Nullldata Jun 20 '18 at 7:14
0

You should ONLY restore the Admin Database. The other three DBs will be recreated. The other trick is to "Name" the Search Service after your Databases and then rename it afterwards. I review these steps in my Upgrade class on Pluralsight.

  • It seems to be the Admin database that is having the issue. I can't restore it, even if I rename the search service after the database. Can you give me a link to Pluralsight? :) T\hanks for your answer. – Nullldata Jun 20 '18 at 7:00
  • Can you confirm that the ONLY DB you restored is admin and the other 3 databases do not exist before you perform the restore and upgrade? You can get to my PS class here: pluralsight.com/courses/upgrading-farm-sharepoint-2016 – Matthew McDermott Jun 20 '18 at 17:14
  • I resolved the issue now. I forgot to remove references to the deleted databases from "Get-SPDatabase" – Nullldata Jun 21 '18 at 8:41
  • If you think this helped you, can I get you to mark it as the answer? – Matthew McDermott Jun 23 '18 at 16:30
  • Sorry Matthew, the actual answer was unrelated to the answer you provided. – Nullldata Jun 24 '18 at 16:54
0

It turned out that there were remnants of the previous attempts in the SharePoint configuration database.

Get-SPDataBase

I removed these by issuing the following commands:

$delete = Get-SPDatabase "ID"
$delete.delete()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.