BuildMaster Documentation

Backing-Up BuildMaster

As the home for all of your applications' build and deployment plans - and all of the other application configuration data - BuildMaster should be backed-up frequently. Fortunately, this is relatively easy to do.

There are three things to back-up on the BuildMaster server:

  • BuildMaster Database - a SQL Server database that contains all of BuildMaster's configuration data; this is pretty important to back-up.
  • Encryption key - the value stored in both the web.config and Otter.Service.config that's used to encrypt/decrypt sensitive data, most notably resource credentials
  • Artifact Library Files - a path on disk that contains all the files for artifacts you created within BuildMaster; this is less critical to back-up.

One thing to note, you may also back up extensions to make a restore to a new server as easy as possible. Just copy whatever is in the extension folder and transfer them to the new server’s folder. Then, restart web app and service, and it will function the same as if you had just downloaded them from Inedo.com.

Backing-up the BuildMaster Database


If you've never worked with Microsoft SQL Server before, not to worry - you won't even know you're working with it. But if you're already familiar with Microsoft SQL Server and know how to back-up and restore databases, you can skip this section. We're not doing anything special, so you are free to use whichever strategy works in your organization. So long as that strategy involves backing-up the database.

If you you installed BuildMaster with the built-in database, then the installer also installed Microsoft SQL Server 2005 Express Edition with an instance named BUILDMASTER. One of the tools installed with SQL Express is the command-line executed osql.exe; it's located in the SQL Server tools directory: C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn.

You can use a single command to back-up the database, which you may need to run as an administrator if you have UAC enabled in Windows.

        	osql -S .\BUILDMASTER -E -Q "BACKUP DATABASE [BuildMaster] TO DISK=N'C:\Backups\BuildMaster.bak' WITH FORMAT"

      

You can obviously customize the path on disk as needed. To run this command on a regular basis, just set-up a scheduled task using the Task Scheduler. Note that you can back-up BuildMaster at anytime without having to stop any of the services.

Backing-up the Artifact Library Files


By default, artifacts are created and retrieved from the C:\BuildMaster\Artifacts directory. The files within this directory are organized in the following folder structure.

(C:\BuildMaster\Artifacts\)
    \(applicationid)
       \(releasenumber)
          \(buildnumber)
             \(deployableid)
                \(artifactname).zip

Obviously, if you create a lot of big artifacts, the root folder will get grow quickly. If you choose not to back this folder up, then you will simply get an "ArtifactName.zip not found on disk" error when you try to download (from the web interface) or deploy a build artifact. That may be a big deal... or not.

Restoring a BuildMaster Installation

There's generally three reasons why you might want to restore a BuildMaster installation from back-up.

  • Rolling-back to an earlier version of BuildMaster - if there were issues with or during the installation of a new version of BuildMaster.
  • Moving BuildMaster to a new server
  • Undoing a Serious Error

The Easy Way (Restore from same version)

The easiest way to restore a BuildMaster installation is to first ensure that you have a working BuildMaster installation that has the same version number number of your back-up. That means you'd want to restore a 2.6.1 back-up to a working 2.6.1 installation, etc. If you're not sure what version your back-up is (perhaps your server blew up and you only have the .bak file), then you'll have to use the advanced way described after this section.

If you backed-up your database using the command above, then you can use the following command to restore:

        	osql -S .\BUILDMASTER -E -Q "RESTORE DATABASE [BuildMaster] FROM  DISK = 
	N'C:\Backups\BuildMaster.bak' WITH  FILE = 1,  NOUNLOAD,  STATS = 10"

      

Just make sure the BuildMaster Windows Service(s) are stopped, otherwise SQL Server will complain with a "database in use" error.

After you get the database up, just make sure your artifact files are where they should be, and you'll be good to go. Easy, right?

The Advanced Way (Restore from any version)

This isn't really that much harder, but it does involve some knowledge of Microsoft SQL Server or the willingness to contact us for assistance. Firstly, you won't be able to restore a newer back-up to an older version (i.e. a 3.0.0 back-up to 2.6.1). But since you should never need to do that anyway, there's nothing to worry about.

If you're using your own SQL Server, then all you need to do is make sure the BuildMaster Database has been restored before running the installer of the version you want. The installer will make sure the restored database is up-to-date as part of the installation.

If you want to use the built-in database, then start by running the installer. It will install the files and create a new BuildMaster database for you. From here, restore your database back-up (you can use the command above) and then run the Database Tool (available from inedo.com) for the version you are installing. That will ensure the database is up-to-date.