Transform file not working for Service windows

I deployed my package in this path

my configuration transform file in octopus

but not working :frowning:

Hi Yassine,
Sorry to hear your config transforms are not working as expected.

If possible can you send me the Octopus Server version you’re running and the Raw Task log from deployment which is not transforming the configuration correctly?

Is it possible that there is a mismatch in the naming convention of your Octopus Environment and that of the corresponding config transform? As an example if your package contains the configs below when deploying to an environment named " Test ", Octopus will execute the transforms in this order: YourService.exe.Release.config , followed by YourService.exe.Test.config, matching the environment from the config to the environment in the Octopus.

  • YourService.exe.config
  • YourService.exe.Release.config
  • YourService.exe.Test.config

Here’s a couple of links to our Config Transform documentation and our troubleshooting guide for more information.

I’ve made this a personal message to protect any sensitive information you may send through in your task logs, but if you’d rather send them to our secure email at that’s fine too.

Thanks for reaching out and I look forward to hearing from you shortly.

Kind Regards,


I’m using Octopus :

Now it’s working

I thought it was replacing the contents of one file with another.

For example replace :

All content of file


But the correct behavior is you must use the syntax: XML-Document-Transform for the sections to replace.

Is not possible to replace the contents of one file with another ?

Other question : In my package I have SQL script (insert, update, create ) I need to execute it by Octopus have you link to help me for this ?

Thanks All

Hi Yassine,
Glad to hear you were able to get this working. Your current understanding of Transform replacement is correct. Replace the contents of one file with another would require some custom scripting, as there’s no such feature out of the box. If you are just replacing one file for another you might want to rename the file, which you could do using a script inside of the package step and Rename the file.

As for running SQL scripts from your package, you do this by utilizing the “SQL- Execute Script File” Step seen below.

The SQL Script File section in the step configuration expects a path to the script file. You can get the path that your package installs to by using an output variable, which would be followed by your script file name. In your SQL Script File section, the value should look like the following (input your script file name):
#{Octopus.Action[Deploy Package].Output.Package.InstallationDirectoryPath}\ScriptFileName.sql

I hope this helps! Let me know if you have any further questions going forward.

Kind Regards,

Thank you for your response, the configuration of the name file works: smile:
About the SQL script, the octopus executes all files in “Path to script files” but in descending order
I’m used “Reg Ex Version File Name” but i d’ont know how to put syntax for sorting files
I would like execute my files in this order :


Hi Yassine,
So sorry for the delay in getting back to you.
To execute the scripts in a particular sequence try naming scripts as seen below:
Script0001xxx.sql / Script0001-GetsomeTask.sql
Script0002xxx.sql / Script0002-UpdateSomeData.sql
Script0003xxx.sql / Script0003-ChangeUserAccess.sql

I’d also suggest refraining from using any special characters [^$.|?*+() in your filenames, as they have special meaning in Regex.

Here’s one more link that might be helpful as you move forward with database deployments.

Once again I’m very sorry for the delay in getting back to you. I hope this helps!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.