2014-02-24 33 views
4

我有我們構建服務器操作系統重建,所以我安裝一個乾淨的隊伍城市,現在我嘗試使用命令行工具來恢復備份:恢復團隊市數據庫之後,一個乾淨的安裝

maintainDB.cmd restore -F <full file name of TeamCity backup file> -T <path to the database.properties file> 

但失敗:

Failed: The file "<path to the database.properties file>" doesn't doesn't contain connectionUrl property. Ignore settings from this file. 

我正在使用內置的基於文件的數據庫。備份是從TeamCity 7.1完成的,現在我安裝了8.1(最新版本)。我怎樣才能恢復它?

回答

3

該文件似乎質量相當低。什麼,你需要運行是:

maintainDB.cmd restore -F <full file name of TeamCity backup file> -T c:\TeamCity\config\database.hsqldb.properties.dist 

或無論是在安裝的正確路徑database.hsqldb.properties.dist

3

按照文檔:

若要從備份文件中恢復的TeamCity服務器:

  1. 確保TeamCity的服務器沒有運行。
  2. 創建空目標TeamCity數據目錄,配置外部數據庫並將數據庫驅動程序放入lib/jdbc子目錄中。

這可能是您的問題的根源。您需要創建一個空的TeamCity數據目錄,然後取.BuildServer \ config \ database.hsqldb.properties.dist文件 - 它是一個模板文件 - 並將其保存爲database.hsqldb.properties。該文件包含連接URL屬性: _connectionUrl =的jdbc:HSQLDB:文件:$ TEAMCITY_SYSTEM_PATH/buildserver_

確保您連接的URL是正確的

3.使用位於/ bin目錄下的maintainDB實用程序(僅適用於TeamCity .tar.gz和.exe發行版)。 使用restore命令:

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> 

-a參數可如果你有TEAMCITY_DATA_PATH環境變量設置可以省略。 如果要將數據恢復到創建備份的同一數據庫中,則可以省略-T參數。

到目標數據庫的database.properties文件的路徑必須是路徑到您的新database.hsqldb.properties從模板創建。