Do not overwrite some files during package install

as far as I can understand there’re 2 options available by now for installing service.

  • recreate target directory
  • overwrite target directory

But what can be done to install to the same directory, but keep a few files not overwritten? E.g. windows service uses some sort of local database (MS SQL Server LocalDb, in fact), and I want this cache to remain during service updates. Here’re a few possibilities available:

  • don’t ship initial database with service, recreate it (if needed) on startup (currently I ship initial database with service)
  • somehow tell octopus deploy to omit database file from overwriting (is it possible?)


One approach would be to perform the copy yourself - that is, let Octopus extract the package to the default place, and then in Deploy.ps1, use XCopy to move the files to the right place and ignore the specific files you don’t want to change.

Otherwise yes, I think not shipping files that you don’t want to overwrite would be a good option.