Problems upgrading Service Databases
Hello,
I am in the process of doing a test migration from SharePoint 2010 to SharePoint 2013. I have restored my service application databases onto my new server however when I go to upgrade the Secure Store Service database I get the following error:
Any help would be very much appreciated
PS C:\Users\administrator.FC> $sss = New-SPSecureStoreServiceApplication -Name '
Secure Store' -ApplicationPool $applicationPool -DatabaseName 'Secure_Store_Serv
ice_DB_f36cca213798469284bbff97dff6dcea' -AuditingEnabled
New-SPSecureStoreServiceApplication : A SharePoint database named
Secure_Store_Service_DB_f36cca213798469284bbff97dff6dcea already exists. You
must supply another name for the new database.
At line:1 char:8
+ $sss = New-SPSecureStoreServiceApplication -Name 'Secure Store'
-ApplicationPool ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidData: (Microsoft.Offic...viceApplication:
SPNewSecureStoreServiceApplication) [New-SPSecureStoreServiceApplication],
SPDuplicateObjectException
+ FullyQualifiedErrorId : Microsoft.Office.SecureStoreService.PowerShellCm
dlet.SPNewSecureStoreServiceApplication
July 22nd, 2013 6:16am
sounds like the cmdlet is trying to create a new database, does the account you use to run PowerShell have enough permission for the security store database? i guess it does not have permission so it try to create a new one.
July 23rd, 2013 4:01am
how do I check this? I have imported in my old security store database. what permissions does it need?
July 23rd, 2013 5:34am
a simple way is to run PowerShell with the Farm Account for the new 2013 farm, and change the dbo of the sss database to this farm account.
July 23rd, 2013 6:02am
Do i change the owner of the database in SQL Management console or do i assign the farm account db_owner rights?
July 23rd, 2013 11:35pm
Actually, it is trying to create a new Secure Store Database with the same name as your old one and hence you are getting "A SharePoint database named Secure_Store_Service_DB_f36cca213798469284bbff97dff6dcea already exists"
You said that you are doing test migration. Do you have the flexibility of doing a trial and error. Better create a backup of your existing database.
What I would suggest is use a different name for the database. Let it create the SecureStoreApplication first and then update the database.
July 24th, 2013 12:15am
Actually, it is trying to create a new Secure Store Database with the same name as your old one and hence you are getting "A SharePoint database named Secure_Store_Service_DB_f36cca213798469284bbff97dff6dcea already exists"
You said that you are doing test migration. Do you have the flexibility of doing a trial and error. Better create a backup of your existing database.
What I would suggest is use a different name for the database. Let it create the SecureStoreApplication first and then update the database.
Here are different ways to attach (in my previous reply, I used "update") an existing database.
http://technet.microsoft.com/en-us/library/ff628582.aspx
So, first create the SecureStoreApplication using a different database name, and then attach existing database using one of the above methods.
July 24th, 2013 12:24am
Thanks for that. Once i've reattached the database and pointed the secure service database to the restored DB using the last method you have listed do I need to do anything to upgrade the database?
July 24th, 2013 12:42am
As far as I know, you do not have to do anything. Delete the new dummy database that you will be creating in the first step. Makes sense?
July 24th, 2013 12:47am
Yeah - so create the new database using the powershell commands, then attach my database once I've finished?
July 24th, 2013 12:48am
exactly!
July 24th, 2013 12:49am
Would i follow the same process for the other service apps?
July 24th, 2013 12:49am
yes. best practice is to always have a pristine backup of your databases.
July 24th, 2013 12:50am
do you mean a backup of the sharepoint databases from the 2010 environment or a backup of the DBs that the service apps create in 2013?
July 24th, 2013 12:52am
backup of databases from 2010 environment. let me know if it works or not.
July 24th, 2013 12:59am
Im now getting these errors when I run the script again:
New-SPSecureStoreServiceApplication : Secure Store Service Application with
name 'Secure Store' already exists. Rename the application or delete the
existing application before you create one with the same name.
At line:1 char:8
+ $sss = New-SPSecureStoreServiceApplication -Name 'Secure Store'
-ApplicationPool ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidData: (Microsoft.Offic...viceApplication:
SPNewSecureStoreServiceApplication) [New-SPSecureStoreServiceApplication],
SecureStoreServiceException
+ FullyQualifiedErrorId : Microsoft.Office.SecureStoreService.PowerShellCm
dlet.SPNewSecureStoreServiceApplication
So I went into the CA console and tried to edit the database for the secure store service so it points to the restored one. I then got this error:
Creation of Secure Store Service Application Secure Store Service failed because of the following errors: Database 'Secure_Store_Service_DB_f36cca213798469284bbff97dff6dcea' on server 'ftgh-share02' is already in use by another service.
Ive only assigned this database to this application!
July 24th, 2013 2:44am
Ive just noticed on my applications list i have
Secure Store Service Secure Store Service Application Started
Secure Store Service Secure Store Service Application Proxy Started
Secure Store Secure Store Service Application
Ive got two sets of them. do i only need one?
July 24th, 2013 2:46am
Yes, you should have only one.
Delete the application that's called "Secure Store".
I hope you do not have any critical information and it is only a test environment. If it is production environment, you should contact Microsoft Support. If it is a test environment and you can take risks then I am glad to help you.
July 25th, 2013 12:14am
Yes, you should have only one.
Delete the application that's called "Secure Store".
I hope you do not have any critical information and it is only a test environment. If it is production environment, you should contact Microsoft Support. If it is a test environment and you can take risks then I am glad to help you.
It is 100% a complete test environment. I have virtualised my production servers into a test environment and I can take risks. i will remove the secure store application and will just have the one application and will attach the old 2010
database to that secure store application service.
So when the databases are attached to teh secure store service will they go through an upgrade process?
July 25th, 2013 3:01am
So when the databases are attached to teh secure store service will they go through an upgrade process?
SharePoint will automatically take care of it. You do not have to worry about that.
July 25th, 2013 5:14pm
Fantastic. so what i will do is assign the existing restored databases to the service applications that either do exist or will be created. Am i on the right track>
Thanks
July 25th, 2013 11:43pm
Yes, that sounds good. Let me know how it goes.
There should be only 1 service application and 1 service application proxy.
July 26th, 2013 12:20am
cool. So that would also be the same for the other service databases as well? (as in one for each?)
Thanks
July 26th, 2013 12:25am
yes.
July 26th, 2013 1:18am
Excellent. Just in the process of moving all the databases over now and attaching them to the already existing service applications (although i dont know why the Microsoft documentation says you have to create them when they already exist) although
i see that the User Profile service application cannot be updated with the restored database names so I am going to delete the existing one and start again specifying the restored databases.
Sorry about all the questions - this is the first test migration I've ever done.
July 26th, 2013 8:09am
How is the upgrade process going?
July 29th, 2013 10:20pm
Havent had much of a chance to look at it since last week :( I am up to the point of deleting and recreating the User Profile service application as I cannot update the database path in the existing User Profile service application database as per
my last post. Is this normal for the User Profile service app?
July 29th, 2013 11:34pm
I am not sure about User Profile Application. What happened when you tried to supply existing db name.....did it give you an error?
July 30th, 2013 1:29am
the db field is greyed out so i cant specify the restored db
July 30th, 2013 1:31am
I am now trying to restore the Search Service Application databases, but when I try to assign the databases to the Search Service Application via PowerShell I get the following error
Set-SPEnterpriseSearchServiceApplication : An item with the same key has already been added.
This is following the instructions that Microsoft have on their site.
August 1st, 2013 2:39am
I have had issues upgrading the Search service application so I have left this one. When I follow the instructions on the Microsoft site I get an error that the database already exists!
I am unsure if i have followed the upgrade of the application databases properly. All i have really done is attached the restored databases to the new apps that were created.
August 1st, 2013 6:50am
I am clueless....sorry. Maybe you should consult Microsoft?
August 2nd, 2013 5:31pm