Problems migrating to database (mssql)

I cannot get the maintainDB script to work. I've followed the instructions for setting up the database; created a file placed in the .BuildServer/system folder. This the command i'm using...

maintainDB migrate -T c:\Users\Sean\.BuildServer\system\

and the result...

C:\TeamCity\bin>maintainDB migrate -T C:\Users\Sean\.BuildServer\system\
Java executable is found: 'java'.
TeamCity maintenance tool. Copyright 2011 JetBrains s.r.o. All Rights Reserved.

Command line arguments: migrate -T C:\Users\Sean\.BuildServer\system\
Using TeamCity data directory: C:\Users\Sean\.BuildServer
Cannot proceed with 'migrate' command: Source database not specified and not found.
Critical error has occurred during command execution.

and here is the properties file


# The maximum number of connections TeamCity can open on database server.

# Specifies whether TeamCity should check each jdbc connection before use.
# It reduces the system performace but avoids cases when the system uses
# a connection that was closed by database server due to time out or this
# connection was broken at the previous operation.

Any ideas why this isn't working?

Comment actions Permalink

Hi Sean

Probably there is no TEAMCITY_DATA_PATH environment variable specified, so the tool cannot find your data directory.
Try to specify it explicitly by -A c:\Users\Sean\.BuildServer parameter.

Comment actions Permalink

Thanks Michael for your reply. However, i've tried the A switch and I've set the environment path per the instructions....i'm lost as to what the problem may be.

Comment actions Permalink

Hello Sean,

The maintainDB tool can migrate a TeamCity database from one RDBMS to another one (possible same RDBMS types). Each database is specified by a special properties file. You can specify both source and targed properties files or just the target one only, in this case maintainDB will use the '' file (that is in the 'config' subdirectory of the TeamCity data directory) as the source definition. Or, if this file doesn't exist but the internal database exists the last one will be treated as the source database.

So, if you're going to migrate from internal database to MSSQL, ensure that the internal database presents in the 'system' subdirectory and the '' file points to the internal database or doesn't exist.

Best regards,

Comment actions Permalink

Thanks Leonid!

Your response was helpful and lead me to completing the migration from the default store to mssql. However, now when i attempt to view the web app i get the following....

TeamCity server requires technical maintenance. Please let the server administrator know this.

I click the link ('I'm a server administrator, show me the details) and then prompted for a maintenance token. It reads the token can found in the teamcity-server.log. Not in mine it doesn't :).

Where can i find this token as it is clearly is not where I'm being told to look.

Thanks again for your help.

Comment actions Permalink

Never mind I found it.


Please sign in to leave a comment.