Teamcity restore a deleted build configuration
Asked Answered
P

3

9

Is there a way in teamcity to restore a deleted build configuration. I found Restore just deleted project which is about restoring a deleted project but can't find any information about restoring a deleted build configuration. I am using Teamcity 8.0.6

Pavlov answered 3/12, 2014 at 11:15 Comment(0)
P
6

TeamCity 9, locate your data directory and you'll find a trash folder, like so:

D:\TeamCity\Data\config\_trash

Take a copy of the whole thing to some other folder, just in case.

Move the effected project folders from config\_trash to config\projects.

Remove the suffixed .projectNN from each project folder.

You may see critical errors in the main web portal while this is happening.

Restart TeamCity just for good measure.

Suffixes

Phallicism answered 22/8, 2016 at 15:35 Comment(2)
Note: since this mess-up, I enabled storing config in Git which took all of 3 minutes to setup and is well-recommended.Phallicism
I accidentally deleted a whole project and its build configurations, and this is exactly what I did to recover it; I found that the project didn't reappear until I had restarted the service, so I suspect it's a mandatory step rather than a "just for good measure".Avoid
S
2

The previous versions of build configuration setting are stored in /config/projects/buildTypes folder in different *.xml.N files. To restore setting replace *.xml file with *.xml.N file. Also since TeamCity 9 it is possible to store all project setting in VCS.

Schapira answered 12/12, 2014 at 17:15 Comment(5)
This will probably help in restoring the changed settings. I don't think it keeps files for deleted build configurations. All xml files related to a build are deleted as soon as we delete the build configuration.Pavlov
You are right. It is not possible to restore deleted build configuration. We have the related request youtrack.jetbrains.com/issue/TW-34774, please vote. However Version Settings feature is present to solve this problem.Schapira
Already voted there. Apart from version settings, we can restore it from a backup as well. The back up one will work in Teamcity 8 as well.Pavlov
We were just able to do this with TC9. Deleted build configurations are stored for 24 hours according to their documentation (confluence.jetbrains.com/display/TCD9/…), although we have some really old ones--maybe the TTL for trashes can be changed. You can restore by going to <TeamCity Data Directory>/config/_trash and moving the <project name>.projectN directory back to <TeamCity Data Directory>/config/projects and removing the .projectN part.Lehrer
@ sixstringtheory Not talking about restoring Projects. I am talking about Build Configurations.Pavlov
B
0

Another option, available since 9.0 is to place project settings in version control (Git, Mercurial, or Subversion and Perforce since 9.1), and then restore removed files using VCS commands.

Baklava answered 27/7, 2015 at 17:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.