Connection Strings not updating in DBUP

The database server on one of our UAT environments was recently replaced.

The first deployment of a DBUP release to this new server failed.

Upon investigations it was found that the connection strings in the app.config had the old server details.

Other deployments, like web application updates, using Octopus to this server have succeeded.

The connection strings used in the app.config file for dbup for each environment are stored in variables. The same goes web applications that have database connections.

The variable relating to this environment was updated for said server to the new details.

However, when it comes to deploying our most recent database release using Octopus the connection strings in the app.config relate to the old server so the deployment fails.

What step am i missing? Why didn’t Octopus pick up the new connection details from the variable and apply to the app.config?

One thing though, the DBUP build that we are trying to deploy was created before the change to the server. The same build has been deployed to other servers in our dev and test environments. Doesn’t Octopus pick up the variables settings and apply them at deployment time?

Thanks in advance

Hi Mazhar,

Thank you for your question. From the description, I suspect that the variable snapshot for your release is from before the connection string was updated.

Variables are snapshotted when a release is created, and any variable changes after the release is created won’t be reflected if that release is re-deployed. You can view the snapshotted variables for a release by clicking “Show snapshot” on the release screen. If the connection string variable is out of date, you can click “Update variables” or create a new release to get an updated snapshot.

I hope that is helpful. If the variables for the release are up to date and you are still getting an incorrect connection string, please let me know (including any additional information you can provide about your DBUP step) and we can investigate further.

Regards,
Jayden

Thanks @Jayden_Platell. That explains it. I always assumed that the variables are read at run time during a deployment I didn’t know about snapshots. I now know for future reference.

No problem at all! Thanks for reaching out to us.

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