OCS 2007 R2 Hotfix Issue with OCS2009-DBUpgrade.msi
18/12/13 09:25 Filed in: Lync
Yes, a blog about OCS 2007 R2....
Why am I blogging about OCS 2007 R2? Well, a lot of sites with this deployed are now moving to Microsoft Lync 2013 - OCS 2007 R2 is at the edge of the support matrix between the two as far as inter-op in the same forest is concerned. So you can put Lync 2013 and OCS 2007 R2 in the same forest and have interoperability between them.
As part of that interop, you have to make sure that the OCS 2007 R2 infrastructure has the right minimum Cumulative Updates (CU) applied - specifically, this one:
Updates for Communications Server 2007 R2
As part of that upgrade process, you have to apply an update to the Back End database - that described in KB2512777. Now there’s lots of stuff out there on the Internet about issues with the OCS2009-DBUpgrade.msi process, and how to get around them, so I won’t repeat the most common issues. We did however recently run in to an interesting one that got us scratching our heads on how to fix.
While running the BE database update, the script was coming up with the wrong locations for the database files, and failing. The database files were stored on a failover cluster (Does anyone else still refer to this as a Wolfpack cluster?) and it was failing as part of the upgrade with an error when the dbsetup.wsf was executed (this is called from the dbqfeupdate.wsf script):
Unable to access data drive as represented by \\server\c$\path
In the above you can see on the final line that the location is a local UNC path to the C drive (C$ share) - not where the databases are stored.
Now, fortunately the ‘dbsetup.wsf’ has some embedded command line switches that I can’t readily see documented anywhere - other than in the script itself. Some of those switches, and their descriptions, are shown at the bottom of this article.
So using some of these switches we can actually tell the script where the database files are, rather than relying on discover. For example, to fix our issue above where the database files are on the M: drive, we used the following script format:
cscript dbsetup.wsf /Verbose /Role:ee /SqlServer:SQLServer /dbpath:DatabasePath /logpath:LogPath
Using the above switches meant that the upgrade ran through as expected, and the back-end upgrade was applied.
[/clean | /drop | /detach | /checkspace | /movefiles | /setsecurity]
[/sqlserver:value] [/sqluser:value] [/sqlpassword:value]
Clean : Clean installs the database. If an existing database exists
it will be dropped and recreated (all data in it will be
lost.) If this option is not specified, the default action
is to upgrade the database (if it exists) while preserving
drop : Removes an existing database. (All data in it will be
detach : Removes the database from SQL Server without deleting the
data and log files.
attach : Attaches the database from the specified dbpath & logpath
checkspace : Verifies that the specified dbpath and logpath has sufficient
disk space. The exit code from the script is zero when
sufficient space exists and non-zero otherwise.
movefiles : Moves the data file and/or log file of an existing database
according to the dbpath and/or logpath parameters specified.
setsecurity : Adds specified NT account(s) as members of specified db
dbexists : Checks for an existing database and returns its status.
dbname : The name of the database to create. The data file for
this database will be created in the default location,
which is where SQL Server is installed.
(Defaults to %1.)
dbfilebase : The base string to use for naming database objects related to
files. The default is to use the dbname as the base string.
For eg. if the database name is rtc_temp, instead of creating
a database file called rtc_temp.mdf, a dbfilebase of rtc can
be specified to create a database file called rtc.mdf.
dbsize : The size of the data file in megabytes.
(Defaults to %2 MB.)
dbpath : The path where the data file should be located for this
database. Drive letter is required, ie c:\db.
(Defaults to SQL setting.)
logsize : The size of the log file in megabytes.
(Defaults to %3 MB.)
logpath : The path where the log file should be located for this
database. Drive letter is required, ie c:\log.
(Defaults to dbpath.)
sqlserver : The SQL server instance to install the database on.
e.g. \\server1\rtc for the SQL instance named 'rtc' on
the machine named server1.
(Defaults to the %4 instance.)
sqluser : The SQL user account used to perform the setup.
If not provided, Windows authentication will be used.
sqlpassword : The password for sqluser. (Not applicable if sqluser is
sqlfilepath : The path for the sql files. (Defaults to .\ if not
verbose : If specified, output will be verbose.
noreindex : If specified, it will not reindex the database on an upgrade