chandler's blog - MOSS SharePoint 2007, Office 2007, Windows Server 2003 RSS 2.0
 Sunday, 02 December 2007

Issue:

I am using SharePoint Server 2007. All my SharePoint Databases are stored on my SQL Server 2005, where Mirroring (for better redundance) is active.

If my principal SQL Server fails, all my SharePoint databases are active on my mirrored SQL Server and I have to tell my SharePoint Server the new SQL Server name.

I wrote a script, which contains all stsadm and windows commands to automatically change the database settings for my SharePoint Server.

  1. Create an empty batch file (new text file with extension *.bat) - e.g.: switch_sharepoint_dbs.bat

   enter the following commands: (bold -> enter your data, red -> comments)


      stsadm -o renameserver -oldservername oldsqlserver -newservername newsqlserver
       
(changes the name of the SQL Server)

      dir c:\windows /s
       
(one way to make a short break, before the next command will be fired -> needed)

      stsadm -o editssp -title SharedServices -ssplogin sspusername -ssppassword ssppassword
       
(Shared Service Provider Login Information has to be reentered)

      dir c:\windows /s

      iisreset

      dir c:\windows /s

      net stop sptrace

      net start sptrace

       (SharePoint Trace Service has to be restarted)

 

      dir c:\windows /s

 

      net stop sptimerv3

      net start sptimerv3

       (SharePoint Timer Service has to be restarted)

 

      dir c:\windows /s

 

      net stop spadmin

      net start spadmin

       (SharePoint Admin Service has to be restarted)

 

      dir c:\windows /s

 

      net stop osearch

      net start osearch

       (SharePoint Search Service has to be restarted - 2 times!)

 

      dir c:\windows /s

      dir c:\windows /s

 

      net stop osearch

      net start osearch

       (SharePoint Search Service has to be restarted - this is the second time)


To test the script, run a failover for all SharePoint databases. After that run the batch file. SharePoint Server will be up and running again after few minutes.


That's it! Have fun and good luck!

Sunday, 02 December 2007 12:24:06 (W. Europe Standard Time, UTC+01:00)  #    -
SharePoint
About the author
DI(FH) Handler Christian

DI(FH) Handler Christian
Graz, Austria


SharePoint Consultant &
Information Manager

© Copyright 2018
Categories
Archive
<2007 December>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Blogroll
Statistics
Total Posts: 19
This Year: 0
This Month: 0
This Week: 0
Comments: 59

Sign In
All Content © 2018, DI(FH) Handler Christian
Graz, Austria