TeamCity migration without build history
We use TeamCity 10.0.4 (build 42538) and want to migrate to the latest version (2022.04) with all our build configurations but without the build history. We saw here https://www.jetbrains.com/help/teamcity/how-to.html#Copy+Manually that:
if you want to do a quick check and do not need to preserve the build history on the new server, you can skip Step 6 (cloning database) and all the optional items of Step 4
Unfortunately by doing this manual copy we were not able to run the new instance without cloning the database, even after doing a "TeamCity Backup" (Administration > Backup > Run Backup) of the server settings, projects and builds configurations.
Do you know a way to migrate to a newer TeamCity version by keeping all the build configurations and removing the entire build history ?
Please sign in to leave a comment.
Hi! As I understand, you pretty much only need to copy the projects to the new server. Their settings are stored in the <data directory>/conf folder. The database is not required to copy them. So the provided instructions should get you covered, and you shouldn't need to copy the database. Could you clarify the exact symptoms of not being able to run the new instance without cloning the database?
Thanks for your answer. We were not able to run the new instance without cloning the database, because:
We'll restart the installation to take a more precise screenshot of the error we got.
Note: we use an external Microsoft SQL Server database (on another machine), so we configured the database.properties file with the connection string using a database name that does not exist.
Anatoly Cherenkov, please find below the error we get after specifying the data folder which contains the config folder with the settings of the old TeamCity server, without providing a database.
Hi! The database needs to exist. To create an MS SQL DB, you can apply to this section of the documentation: https://www.jetbrains.com/help/teamcity/setting-up-teamcity-with-ms-sql-server.html
I hope this helps!
Hi Anatoly Cherenkov, I work with Eric on this subject. I created the Microsoft SQL Server database from scratch following the documentation you given us.
But we still have the same error. See the screenshot below:
Waiting for news from you on this subject. Please be sure that your help is greatly appreciated.
Thanks in advance,
Hi Rancurel, it looks like you've skipped this step of the how-to:
Configure the new TeamCity installation to use proper
<TeamCity Data Directory>and database (.BuildServer/config/database.propertiespoints to a copy of the database)..BuildServer is used interchangeably with <TeamCity Data Directory> in that how-to. Please note that in the case of using an external database, a blank database needs to be created by the user. This documentation section explains how to create a blank MS SQL Server database.
Hi Anatoly Cherenkov, the database has been created and the file Database.Properties has been set accordingly. See below the screenshot of the database.properties file and note also on the previous screenshot with the error that the check can find the database file
Best regards,
Hi! Please make sure the database itself also exists (not just the pointer to it in the database.properties file). Please note that even if you don't copy the database over, it has to exist. In your case, it has to be a blank database, and you will need to create it if it does not exist. In my previous comment, a left a link to our recommendations on creating a blank MS SQL database.
I hope that helps!
Hi, yes, the database exists and is configured with the same user as the one specified in the database.properties file. Se the screenshot from MS SQL Server database management studio from the server.

Hi! I'd recommend reviewing the teamcity-server.log since the server startup. It should show what database.properties file and which database connection string TeamCity uses. That info should be key to resolving the issue. Also, feel free to attach the teamcity-server.log if you'd like me to have a look at it.
Additionally, you may try to redo the migration steps from scratch to ensure you take all steps in the order they are given in the documentation. If you can consistently reproduce the issue, please let me know about the steps because following the stages of the Copy Manually section works fine for me.