I had our build server operating system rebuilt, so I installed a clean Team City and now I am trying to restore the backup using the commandline tool:
maintainDB.cmd restore -F <full file name of TeamCity backup file> -T <path to the database.properties file>
but it failes with:
Failed: The file "<path to the database.properties file>" doesn't doesn't contain connectionUrl property. Ignore settings from this file.
I am using the built in file-based database. The backup was done from TeamCity 7.1, and now I installed 8.1 (latest). How can I get it to restore?
As per documentation:
To restore a TeamCity server from a backup file:
- Make sure the TeamCity server is not running.
- Create the empty target TeamCity Data Directory, configure external database and place database drivers into lib/jdbc sub directory.
Here is probably the root of your problem. You need to create an empty TeamCity Data Directory, then take .BuildServer\config\database.hsqldb.properties.dist file - it is a template file - and save it as database.hsqldb.properties. The file contains the connection URL property: _connectionUrl=jdbc:hsqldb:file:$TEAMCITY_SYSTEM_PATH/buildserver_
Make sure your connection URL is correct.
3.Use the maintainDB utility located in the /bin directory (only available in TeamCity .tar.gz and .exe distributions). Use the restore command:
maintainDB[cmd|sh] restore -F <full file name of TeamCity backup file> -A <path to TeamCity Data Directory> -T <path to the database.properties file of the target database>
The -A argument can be omitted if you have the TEAMCITY_DATA_PATH environment variable set. The -T argument can be omitted if you want to restore the data into the same database the backup was created from.
The path to the database.properties file of the target database must be the path to your new database.hsqldb.properties created from a template.
The documentation seems to be of rather low quality. What you need to run is:
maintainDB.cmd restore -F <full file name of TeamCity backup file> -T c:\TeamCity\config\database.hsqldb.properties.dist
or whatever is the correct path to database.hsqldb.properties.dist
in your installation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With