Problems with upgrade from 4.5 to 5.0

Hi,

I have followed steps described here:
http://www.jetbrains.net/confluence/display/TCD5/Upgrade#Upgrade-win

When I start TeamCity server and open up website, I get this error:

Error on step: Connecting to the database server...

Database version mismatch: Configuration version is 280 but Database version is 343.


Stack trace is as follows:


jetbrains.buildServer.serverSide.db.DatabaseVersionMismatchException: Database version mismatch: Configuration version is 280 but Database version is 343.
   at jetbrains.buildServer.serverSide.impl.DBFacade.checkVersionMatching(DBFacade.java:234)
   at jetbrains.buildServer.serverSide.impl.DBFacade.<init>(DBFacade.java:44)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processStartupServerInternal(TeamCityDispatcherServlet.java:72)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.processServerStartup(TeamCityDispatcherServlet.java:138)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.access$000(TeamCityDispatcherServlet.java:2)
   at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet$1.run(TeamCityDispatcherServlet.java:2)
   at java.lang.Thread.run(Thread.java:595)





Can someone explain why upgrade did not suceed? Thanks.
6 comments
Comment actions Permalink

P.S. I use external database and the last row in db_version is:

version_nr version_time
343 10/12/2009 13:56:15
0
Comment actions Permalink

I have an idea what could have happened here. Basically, I have 2 instances of TeamCity (running on different machines) - they have separate .BuildServer folders, but both use the same external database. So when I upgraded and started the first instance, it updated the external database. Then I upgraded second instance - version.dat in .BuildServer is as follows:

#Mon Sep 07 15:05:43 BST 2009
version.org.hsqldb.jdbcDriver=280
version.net.sourceforge.jtds.jdbc.Driver=280

So I think what happened was - after upgrading second instance, TeamCity expected older version of the database. But the first instance already updated it.

How can I get out of this sticky situation? Thanks.

0
Comment actions Permalink

Hi Vytas,

TeamCity colud not work in case when several TeamCity servers are connected to the same database. Each TeamCity server should get its own database (set of tables with data).
If you want to start two TeamCity servers you have to create two databases for them.

Best regards

0
Comment actions Permalink

I have to say this sounds very surprising. What if I want to run TeamCity on a cluster (which I actually do)? In that case I have 2 or more instances of TeamCity (on each cluster node), but they all are pointing to the same database. Are you saying TeamCity cannot be deployed on a cluster?

Anyways, is there any way to convert files in .BuildServer folder to 5.0? This would solve my problem. Alternatively, is there any way to downgrade TeamCity database? If not, what would happen if I simply remove rows from db_version?

0
Comment actions Permalink

Hi Vytaz,

> What if I want to run TeamCity on a cluster (which I actually do)?

In order to use TC on a cluster, you have to place the TeamCity Data directory onto a shared disk storage, and ensure that TC on each node will attempt to start only when TC on the other node has already shut down.

These requirements are based on two things:

1. TeamCity keeps its data in two places - in relational database and in its Data directory. So both data places have to be consistent.

2. TeamCity has an internal cache (in memory) that keeps some data, including auto-incremental identifiers. So two TeamCity servers connected to the same database will cause identifiers conflicts.

> Anyways, is there any way to convert files in .BuildServer folder to 5.0?

Without the relational database - definitely no. If one TeamCity server did some work with relational database and data files, then the second TeamCity server's datafiles became inconsistent with the relational database. The best option in this case is just drop data files from the second server and copy data files from the first one.

> Alternatively, is there any way to downgrade TeamCity database?

No.

> If not, what would happen if I simply remove rows from db_version?

TeamCity will not work correctly. Because the database schemas of TC 4.5 nad 5.0 are differ.


Best regards

0
Comment actions Permalink

Thanks Leonid. I managed to restore my database and repeat upgrade steps. So everything is working fine now.

0

Please sign in to leave a comment.