Unable to restore Team City database to new server

Hi all,

We are currently attempting to restore a backup of our Team City database (Internal, HSQL) to another server, and are having difficulties.

The process we are currently following is:

1.       Install Team City 7.1.2 on new server with default settings.

2.       Open Team City in Internet Explorer, set up the administrator and accept the Licence Agreement.

3.       Stop the Team City Service

4.       Open Command Prompt as administrator, change directory to “C:\TeamCity\bin”, then run the following command:

maintainDB restore -F "C:\Users\macnrsup\Desktop\Backup_20130114_160820.zip" -T "C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist"

5.       ERROR: Cannot proceed with 'restore' command: The configuration directory (C:\ProgramData\JetBrains\TeamCity\config) is not empty.

6.       As requested by the command prompt message, clear out the config directory

7.       Run the following command again:

maintainDB restore -F "C:\Users\macnrsup\Desktop\Backup_20130114_160820.zip" -T "C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist"

8.       ERROR: Cannot proceed with 'restore' command: The system directory (C:\ProgramData\JetBrains\TeamCity\system) is not empty.

9.       As requested by the command prompt message, clear out the system directory

10.   Run the following command again:

maintainDB restore -F "C:\Users\macnrsup\Desktop\Backup_20130114_160820.zip" -T "C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist"

11.   ERROR: Cannot proceed with 'restore' command: Target database settings file (C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist) not found

12.   I’m then caught in an infinite loop as when I put the properties.dist file back into the config folder, it throws an error again saying the config folder is not empty.

 

If you can give me a steer on how best to do this it would be much appreciated… I’m tearing my hair out trying to find a solution!

6 comments
Comment actions Permalink

Hello Robert.

I had this very problem yesterday as I reinstalled my computer and wanted to restore TeamCity to a backup.

The solution came up as this after tearing almost all my hair out...

1) Copy the C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist to somewhere else, for example C:\database.hsqldb.properties.dist
2) Clear both the conf and system directories (as requested by your error messages)
3) Try your restore-command again. It should work.

Hope it helps

-Espen

0
Comment actions Permalink

Hi,

Thanks for your reply!

My problem is that after clearing everything out and running the command, it then says that it cant find the properties.dist file... so its really a chicken and egg situation. It complains that the folder isnt empty, then complains that theres somethign in the folder when I put the properties.dist file in!

Thanks again.

0
Comment actions Permalink

Your restore-command should use the option
-T "C:\database.hsqldb.properties.dist"
instead of your original
-T "C:\ProgramData\JetBrains\TeamCity\config\database.hsqldb.properties.dist"

That is, your command should be the following (given you copied database.hsqldb.properties.dist to C:\database.hsqldb.properties.dist):
maintainDB restore -F "C:\Users\macnrsup\Desktop\Backup_20130114_160820.zip" -T "C:\database.hsqldb.properties.dist"

Let me know how it goes. It really worked for me this exact way, with exactly the same problem :-).

0
Comment actions Permalink

Ah with you... thanks very much. I'll give it a go this morning and report back. This does seem like the fix though and I'm kicking myself I didnt do a bit more research into the command!

0
Comment actions Permalink

Thank you! It's helped for me too.

0
Comment actions Permalink

Same issue here but all we want is to restore config values nothing else.

Followed your steps while it got us out of the infinite loop scenario we're still unable to update just using the -C command. It completes successfully BUT config directory is empty afterwards.

If we run the command without -C then the complete restore occurs including the config directory, but this is not what we want as we want to keep everything but the config stuff.

0

Please sign in to leave a comment.