I have been planning to put together an article on Upgrading and Moving Virtual Center 4.0 to vCenter 5.0 since a long time and here it goes today.
What we have in Lab?
I have prepared 2 ESX named as ESX4-A and ESX4-B. (we will be upgrading this to ESXi 5 in next article)
Also, I have setup a MS-SQL 2005 Enterprise server on Windows 2003 R2 Enterprise SP2 x86 which is serving as a separate database server for Virtual Center server. This server is named as SQL2005
A Virtual Center 4.0 server on Windows 2003 R2 Enterprise SP2 x86, named as vcenter4
XP Pro workstation from where virtual center will be managed using vSphere Client.
A SQL2008R2 x64 server on Windows 2008 R2 x64 OS, which will serve as Database server for vCenter 5
A Windows 2008 R2 x64 Server which will host our new vCenter Server 5.0
On Virtual Center server a 32-Bit ODBC DSN is created to connect to database VC_DB on SQL2005, using VCDBUser account that is created on SQL Server.
Now, Lets prepare the SQL2008R2 server and install SQL2008 R2 database server. I have also enabled .Net 3.5 feature of windows 2008 R2.
Here is the feature selection page for SQL2008 R2.
Using default instance name.
Using system account for all the services that will be installed. (not as per the best practice)
Default Collation settings Latin1_General.
Used Mixed Mode authentication, as we will be again using SQL user account for database.
Once the setup is complete, set the memory consumption settings under Server properties / Memory. I set it to use 640MB as I am using only 1GB for this server.
Lets move to vCenter5 server, very 1st we will enable .Net 3.5 feature and Install SQL 2008 R2 Native Client x64 so what we can create a x64 bit DSN to connect to database on SQL2008R2, which is a requirement to connect vCenter to SQL.
If you check the ODBC / System DSN and create a new DSN you will not find the Native Client, for that you need to install it.
We will create the ODBC DSN later.
So, we have checked what we have got in hand..
Lets Move the Database now!!
At present virtual center database is served by a SQL 2005 server which is on x86 platform. We need to move it on SQL 2008 R2 x64 on x64 platform.
Let us go to SQL2005 server and detach the database.
Note: When you try to detach, you will see the Database is still in use. Check the Message column, it says “12 Active Connections”
This means the virtual center server is using the database, hence we need to stop the virtual center services before we move ahead.
Once the database is detached, it will not appear under databases section in left panel.
Now, browse to the location where the database files were located.
The default installation will save the files under C:\program files\Microsoft SQL server\MSSQL.1\MSSQL\Data
From here we need to copy VC_DB.mdf and VC_DB_log.ldf files to SQL 2008 R2 server.
On SQL2008R2 server, I copied the files to default location.
Open SQL Server Management studio on SQL2008R2 server and Attach the copied database.
As you can see, VC_DB database is attached.
If we check the Users folder we find user “VCDBUser” associated with the database, but it is not available under “Logins” folder.
Delete the User VCDBUser which is associated with database.
I will create the user VCDBUser with same password as I had before.
User “VCDBUser” with SQL Authentication and Default database set to VC_DB.
Now, we will create a ODBC DSN on vCenter5 Server.
Here you can see the Database that is selected by default is showing “VC_DB” coz we have associated the VCDBUser with this database, which is correct.
We have successfully moved the database from SQL 2005 to SQL2008 R2.
Virtual Center Server Configuration Backup
On Virtual Center server (vCenter4) insert vCenter DVD.
Create a directory named “DataMigration” on C Drive.
Browse the DVD and extract the content of datamigration.zip found under D:\datamigration folder.
Start the Command Prompt with administrator rights and run Backup.bat.
If you get the error similar to this, that means the Command Prompt did not start with Full Administrator privilege.
Make sure to Right Click CMD and select Run As… and UNCHECK “Run this program with restricted access”
Now run Backup.bat again.
The backup is created successfully.
The Configuration backup is done!.
vCenter Server 5 Installation
Now, Copy DataMigration folder from Virtual Center server to vCenter5 server, put it on C drive.
On vCenter5 Server, run Command Prompt with administrator rights.
Put vCenter 5 DVD.
From CMD go to directory C:\DataMigration and run “Install.bat”
It will prompt that the name of system is different than the original. type Y to continue.
It will prompt to enter the Path for media. Type D:\
Installation of vCenter will start.
Continue the setup, it will ask for ODBC DSN. Select the DSN from dropdown that we created before.
Enter the password for the username VCDBUser
Select “Upgrade existing vCenter server database”
In production, you should put the Service Account username and password that you have created for vCenter service.
Continue with the setup. This takes time so be patience.
The Installation will continue with “vCenter Inventory Service”
Upgrade vSphere Client on XP/Win7 workstation using vCenter server 5.0 media.
That’s it. .