Problems upgrading from 4.5 to 5.0

If spent the afteernoon trying to upgrade to 5.0 and SQL Server as database. As I was unable to get it working, I've upgraded to version 4.5 and switched from file to using SQL Server 2005 and that seems to be working fine.
Trying to upgrade further from the working 4.5 to 5.0 still fails. I can not get TeamCity to start up. I get the following error in the teamcity-server.log:

[2009-12-21 16:22:23,210]   INFO - rverSide.db.TeamCityDataSource - Using the following database settings:
database type: MSSQL2005
database driver: net.sourceforge.jtds.jdbc.Driver
connection: jdbc:jtds:sqlserver://localhost:1433/TeamCity
login as: sa
[2009-12-21 16:22:23,522]   INFO -   jetbrains.buildServer.SERVER - TeamCity configuration version is 343
[2009-12-21 16:22:23,569]   INFO -   jetbrains.buildServer.SERVER - Configuration version: 280, Database version: 0
[2009-12-21 16:22:24,053]   INFO -   jetbrains.buildServer.SERVER - Closing database connections.
[2009-12-21 16:22:24,116]  ERROR - er.spring.WebDispatcherServlet - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:/META-INF/plugin-model-shared-spring.xml]
Offending resource: URL [jar:file:/C:/TeamCity/webapps/ROOT/WEB-INF/lib/server.jar!/META-INF/buildServerPluginsSupport.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [jar:file:/C:/TeamCity/webapps/ROOT/WEB-INF/lib/common-impl.jar!/META-INF/plugin-model-shared-spring.xml]; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader]: Constructor threw exception; nested exception is java.lang.NullPointerException
......... (see teamcity-server.log)
I can't find any way to upgrade the database and no instructions on how to do this, only to migrate from one database to another. I've tried to migrate from one database to another on sql server, but the TeamCity says the 4.5-database is corrupt or empy ( I think thta was the message). The user running the installation and the service has db_owner access to the database. Found other posts on upgrading problem referring to a db_version table but there is none in my database so I suspect the database is too old and for some reason TeamCitty is unable to upgrade the database.

How can I upgrade from 4.5 to 5.0 when I'm using SQL Server 2005?

Attaching some of the logs.

Best Regards

Comment actions Permalink

Hello Johan,

I haven't got your case clearly. Which version of TeamCity had you have before upgrading/migrating?

In any case, I reccommend you to (first) upgrade you soft up to 5.0 and then migrate to SQL server.
Currently we don't support upgrading and migrating to another database in "one click".
New migration utility (that is embedded in 5.0) could not work with old databases, it works only with 5.0 databases. It looks you attempted to run 'maintainDB' while the database was not upgraded to 5.0.

> I've upgraded to version 4.5 and switched from file to using SQL Server 2005 and that seems to be working fine.
Am I right that now you have working installation with your data?
If yes, please backup your data directory, upgrade software up to 5.0 and run TeamCity server. On the first start, TeamCity upgrades configuration files and database up to the latest format. After upgrade has done, please ensure that all work correct.

Then, you can migrate to an external database, using the 'maintainDB' utility, as described in

Best regards,

Comment actions Permalink

Hi Leonid/JetBrains,

I'm still having problem getting TeamCity to start. It looks like TeamCity is unable to upgrade the file database as well as a SQL Server database. Also it says the database is empty, which it isn't.

[2009-12-22 10:49:52,145]   INFO -   jetbrains.buildServer.SERVER - TeamCity configuration version is 343
[2009-12-22 10:49:52,177]   INFO -   jetbrains.buildServer.SERVER - Configuration version: 280, Database version: 0
[2009-12-22 10:49:52,177]   WARN -   jetbrains.buildServer.SERVER - Server startup exception: jetbrains.buildServer.serverSide.SystemStartupProblem: Cannot perform upgrade of configuration data while database is empty. Configuration files version (280) does not match current TeamCity data version (343).

I'm also getting a strange error, saying that port 80 is already in use.
2009-dec-22 10:49:51 org.apache.catalina.core.StandardServer await
ALLVARLIG: StandardServer.await: create[8105]: Address already in use: JVM_Bind
at Method)
at org.apache.catalina.core.StandardServer.await(
at org.apache.catalina.startup.Catalina.await(
at org.apache.catalina.startup.Catalina.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.catalina.startup.Bootstrap.start(
at org.apache.catalina.startup.Bootstrap.main(

I'm using 5.0 build 10669.


Comment actions Permalink

Problem solved. Port 8105 was also needed and was taken by another process.

Comment actions Permalink


I'm glad you managed to do it.
One more question: am I right that your TC 4.5 was installed as a Windows service, and when you were installing 5.0 the old one has unexpected started?


Comment actions Permalink

No, it was not the old TeamCity service, it was another Service.

For the future: Where can this second port number be configured?

Best Regards

Comment actions Permalink

The Tomcat shutdown port can be configured in <TeamCity_home>/conf/server.xml.

Best wishes


Please sign in to leave a comment.