Edit Overview
The program ESI.Octopus.GetDbApp.exe is used for :
- Downloading a copy of your Octopus database (DB) from the Octopus server.
- Restoring the DB on an existing SQL server.
This article explains how to use GetDbApp.
Edit Prerequisites
Before using GetDbApp, you need to have :
- A server with SQL Server 2005 (as a minimum, you will need to install the free version of SQL Server 2005 named SQL Server 2005 Express Edition. If you already have an SQL 2005 server, you can use that server).
- A DB name on that server which can be used to restore the DB. Warning, the program GetDbApp destroys the existing DB if it already exists
- A shared directory on the SQL server to which GetDbApp will download the backup file from the Octopus server. Ex: (\\MySqlServer\OctopusBackups\).
- A computer which will execute GetDbApp (included with the Octopus installation).
Edit Parameters of the program ESI.Octopus.GetDbApp.exe
The command-line program requires 3 parameters:
/Login : Username for an Octopus account which will be used to access the Octopus server to download the database.
/Password : Password for the above-mentioned account.
/ConfigFilePath : A path to the configuration file. The next section explains how to prepare the configuration file.
Edit Configuration file
The configuration file is a text file which contains the information about the SQL server, the shared folder and other parameters required by the program. This file uses the XML format.
Warning
Before starting to create the configuration file, be careful not to break the file format by modifying the tags or the file structure. One missing or additional character (for example, a "/", ">", or "<") could make the file useless. Make sure that the specified values are valid. Don't leave any blank spaces before or after the values. If an error occurs with the configuration file, the software will shut itself down without a problem. However, error notifications aren't very clear, so it could be difficult to find errors.
A thorough verification of the values is recommended before starting the program.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<serverBackupLocationUNC>\\MySqlServer\OctopusBackups</serverBackupLocationUNC>
<serverName>MySqlServer</serverName>
<databaseName>OctopusDatabase</databaseName>
<autenticationMode>sql</autenticationMode>
<userName>sa</userName>
<password>password</password>
</configuration>
- With Notepad, create a file with the extension .xml containing the above configuration.
- Replace the values of each parameter.
- Save the file in c:\program files\Octopus\GetDbAppConfiguration.xml.
Note: The configuration element named
authenticationMode could be given the value
integrated. In this case, the configuration lines
userName and
password won't be used. This
integrated mode can only be used if it is supported in the SQL Server configuration.
Edit What exactly does the program do ?
- Connect to the Octopus server.
- Download the Octopus DB backup to the shared directory on the SQL server.
- Disconnect from the Octopus server.
- Decompress the downloaded file to the shared directory.
- Connect to the SQL server.
- Replace the current DB with the newly downloaded DB.
- Disconnect from the SQL server.
- Delete the downloaded files (an option exists in the command line to avoid erasing the file, /KeepDownloadedBackup ).
EditExecuting ESI.Octopus.GetDbApp.exe
- Open a command-line window
- Enter the following command and hit ENTER: c:\
- Enter the following command and hit ENTER: cd c:\program files\octopus\
- Enter the following command, provide the correct values for the 3 parameters, and hit ENTER: ESI.Octopus.GetDbApp.exe /Login: loginname /Password:password /ConfigFilePath: path
Edit How to automate GetDbApp to download every day
To automate GetDbApp, create a scheduled task in Windows which will execute ESI.Octopus.GetDbApp.exe daily or weekly depending on the need.