How I manually migrated from vCenter 4.0(32-bit) to 4.1u1(64-bit)

Last week I upgraded a vCenter 4.0 installation to 4.1u1. The vCenter was installed on a 32-bit VM so I needed to migrate the installation to a new 64-bit host.

I tried to do the migration according to the vSphere 4.1 upgrade pre-installation requirements and considerations guide. But sadly I got an error during the migration process.

RESTORE FILELIST is terminating abnormally.

The error is described in this thread at vmware communities.

Also, the datamigration scripts makes the original vCenter database corrupt. So if the datamigration fails, as it did for me, the original installation is trashed. (Luckily the datamigration scripts exports a backup before trashing it. But this procedure stinks anyway.)

So how did I migrate? Well I found a workaround and did the following.:

On the old vCenter 4.0 server (32-bit)

  1. Stop the vCenter service
  2. Install Microsoft SQL Server Management Studio Express
  3. Open Management Studio and detached the vCenter database.
  4. Copy the database files.
  5. Copy the % ProgramData% \ VMware \ VMware VirtualCenter \ SSL folder.
  6. Shutdown the vCenter VM.

On the new vCenter 4.1u1 server (64-bit)

  1. Install vCenter 4.1u1 with all the default settings. (This installs SQLExpress and the vCenter database)
  2. Uninstall vCenter from add and remove programs. (This does not remove the SQLExpress installation)
  3. Restore the % ProgramData% \ VMware \ VMware VirtualCenter \ SSL
  4. Install Microsoft SQL Server Management Studio Express
  5. Detach the newly installed database and attach the one from the old vCenter server.
  6. Create a ODBC connection to the local SQLExpress server with the old vCenter database.
  7. Install vCenter 4.1u1 and choose existing ODBC connection during the installation. The installer will detect the old vCenter database and upgrade it.

I wonder why VMware don’t recommend this procedure in the first place?

How to backup vCenter running SQL Express

I found a great way to backup the vCenter SQL database running on SQL Express. The downside of running vCenter on SQL Express is the lack of the SQL agent. So running a scheduled backup of the SQL database is a bit tricky.

ExpressMaint is a small application set of scripts/stored procedures that enables you to run backup and maintenance jobs from commandline.(You could run the application ExpressMaint as well, but I installed the stored procedure version.)

I installed and configured it by doing the following:

  1. I created c:\backups to store my backups
  2. I downloaded the ExpressMaint TSQL file.
  3. I opened a new cmd.exe (with administrative rights) and installed the Stored Procedure by running:
    sqlcmd -S .\SQLEXP_VIM -i c:\expressmaint.sql
  4. I created c:\backups\database to store my database backups
  5. I created c:\backups\reports to store my reports
  6. I created c:\backups\backupscript.sql (SQL file that contains the backup settings, note that my script performs the backup and rebuilds the indexes on the vCenter database):
    exec expressmaint
    @database = 'ALL_USER',
    @optype = 'DB',
    @backupfldr = 'c:\backups\databases',
    @reportfldr = 'c:\backups\reports',
    @verify = 1,
    @dbretainunit = 'days',
    @dbretainval = 5,
    @rptretainunit = 'weeks',
    @rptretainval = 1,
    @report = 1
    exec expressmaint
    @database = 'VIM_VCDB',
    @optype = 'REINDEX',
    @reportfldr = 'c:\backups\reports',
    @rptretainunit = 'days',
    @rptretainval = 1,
    @report = 1
  7. I created c:\backups\PerformBackup.cmd (this is the batch script that executes the backup):
    sqlcmd -S .\SQLEXP_VIM -i c:\backups\backupscript.sql
  8. I schedule c:\backups\PerformBackup.cmd using the ordinary Windows scheduled task manager.

Linked: Help! My SQL Server Log File is too big!!! | TechRepublic

Great post about shrinking SQL server 2005 log files.

Shrinking the File

Once you have identified your problem and have been able to truncate your log file,  you may need to shrink the file back to a manageable size.  You should avoid shrinking your files on a consistent basis as it can lead to fragmentation issues.  However, if you’ve performed a log truncation and need your log file to be smaller, you’re going to need to shrink your log file.  You can do it through management studio by right clicking the database, selecting All Tasks, Shrink, then choose Database or Files.  If I am using the Management Studio interface, I generally select Files and shrink only the log file.

This can also be done using TSQL.  The following query will find the name of my log file.  I’ll need this to pass to the DBCC SHRINKFILE command.

SELECT name FROM sys.database_files WHERE type_desc = 'LOG'

Once I have my log file name, I can use the DBCC command to shrink the file.  In the following command I try to shrink my log file down to 1GB.

DBCC SHRINKFILE ('SalesHistory_Log', 1000)

Also, make sure that your databases are NOT set to auto-shrink.  Databases that are shrank at continuous intervals can encounter real performance problems.

Help! My SQL Server Log File is too big!!! | TechRepublic.