Recovering from a lost <TeamCity Data Directory>?

Hi,

I just lost my Lost <TeamCity Data Directory> from a 4.5.5 version.

I'm left with an old backup, probably from 4.5.x, and a database from 4.5.5 version. These are not compatible.

Is there anything I can do to avoid recreating everything from scratch?

best
/nodje

5 comments
Comment actions Permalink

Hi Nodje,

how did you do the backup? which version of TeamCity it was? whether database was internal (HSQL) or external one?

thanks,

Leonid

0
Comment actions Permalink

Hi Leonid,

sorry I haven't provided enough information in the first place.
The backup of the data directory was done as a simple cp -R of the directory. It was version 4.5.1 or 4.5.2.
The database used is MySQL.

cheers
-nodje

0
Comment actions Permalink

Hi,

TeamCity stores its data in two places – in database and in data directory as files. And TeamCity could work properly if data in both places are consistent.

So, what can I recommend to do in this case?

The simplest way is to abandon all data and begin from scratch.


Another way is to try to recover configurations that were saved in your backup and their history. In order to do this, follow the scenario below.

1. Get another computer where TeamCity is not installed (let it be Comp B). Install the old version of TeamCity (this version should be the same as one that was on your production TeamCity when you did the backup of data directory).

2. Start the TeamCity on comp B, ensure that it dows work (but don't create any projects), and shut the TeamCity down. This should initialize a new data directory with internal (HSQL) database.

3. Copy the 'config' subdirectory from your backup into the new created data directory on comp B, except database*properties files.

4. Start the TeamCity on comp B, ensure that all configurations (that were when the backup did) exist, and shut TeamCity down.

5. Upgrade the TeamCity on comp B using TeamCity version exactly as on your production one.

6. Start the TeamCity on comp B, ensure that is does work and shut it down.

7. Copy the whole TeamCity data directory from comp B to the production comp; remove HSQL database from the 'system' subdirectory (several files that names started with 'buildserver').

8. Write the correct 'database.properties' file (see http://confluence.jetbrains.net/display/TCD5/Setting+up+an+External+Database#SettingupanExternalDatabase-MySQL) for the production database.

9. Start the TeamCity on the production comp.

I hope, all data related build configurations referred in the backup should be recovered, including whole history.
Recovering other configurations is a pretty sweat job .


BTW, if you're going to migrate to TeamCity 5.0, I would glad to inform you that 5.0 has a new easy backup feature - even from  Web UI and without TeamCity shutdown (only in case of external database).


Best regards,
Leonid

0
Comment actions Permalink

P.S. If you could not determine which concretely was the version of TeamCity your backup has been done, please attach the 'version.dat' file (from the 'system' subdirectory of your backup) and I'll try to determine it for you.

Regards,
Leonid

0
Comment actions Permalink

Thanks a lot for the very detailed post Leonid.

I'll try and see what I can recover.

cheers
nodje

0

Please sign in to leave a comment.