Problem upgrading 3.0.1 to 4.0.1 (Missing projects)

Windows Server 2003
MySQL database

The upgrade documentation is a bit sparse on the subject of how to restore your old data once you've done the upgrade. I'm hoping someone can help me get going again.

I followed the instructions, backing up my MySQL database, TeamCity folder, and .BuildServer folders. I uninstalled TeamCity and when it asked me what I wanted to delete, I took the default. When I went to install v. 4.0.1 it told me that it still found files and wanted to uninstall. Of course, it couldn't uninstall because I had already done that. I deleted the entire TeamCity directory as well as the .BuildServer directory before it finally would install. Once I got it installed, I restored my old database.properties and dropped the mysql drivers .jar in the lib directory and started Tomcat.

The server remembers who I am and also remembers my other users. However, it doesn't know about any of my projects or build configurations or VCS roots. So, I restored the system and config folders under .BuildServer. Now when I log in it gives me an error:

Critical error  in configuration file C:\TeamCity\Configuration  Directory\.BuildServer\config\DataFeed\project-config.xml:
org.jdom.input.JDOMParseException:  Error on line 6 of document  file:/C:/TeamCity/Configuration%20Directory/.BuildServer/config/DataFeed/project-config.xml:  Attribute "fail-if-tests-failed" must be declared for element type  "build-type".

I get this for each of my projects. Now, before I go manually repairing my project definitions I'm just wondering if I've missed some important step in restoring them?

I'd appreciate any help you can give.

-- Les Walker

4 comments
Comment actions Permalink

You should not be deleting your .BuildServer folder - it is data directory, there is no need to delete it on upgrade. When new server starts it checks version of the data and applies necessary converters. In your case it looks like no converters were applied (you can check it in the teamcity-server.log). Could you please take a look what is in the version.dat file in the .BuildServer/system folder? Did you restore this file too before you started new server?

--
Pavel Sher

0
Comment actions Permalink

Thanks for the help.

I see now. I never restored my version.dat so it thought that it didn't have to do the upgrade. When does it do that check? Can I just restore my .BuildServer directory to it's 3.0.1 state and restart the  build server or do you think that I need to remove everything and reinstall with my .BuildServer directory in place?

-- Les

0
Comment actions Permalink

It should be enough if you restore .BuildServer folder only.

--
Pavel Sher

0
Comment actions Permalink

At some point I must've replaced the version.dat file because when I tried just restoring that it gave me errors on startup. I ended up deleting everything and starting with a clean install on top of my build server directory.

I got confused at one point because my script that restores the database didn't drop some of the new tables resulting in upgrade errors. The correct sequence to upgrade the database is:

1) Make sure that you have the old version.dat in the system directory
2) Delete *all* the tables in the database
3) Restore the database
4) Restart the server

This resulted in the proper database upgrade.

I haven't completely checked things out, but my projects seem to be there. Artifacts, build histories, etc are all intact.

Thanks for the help.

-- Les Walker

0

Please sign in to leave a comment.