DM extended properties were not found on the target database

Automated deployment for web applications and databases

DM extended properties were not found on the target database

Postby swinghouse » Fri Feb 22, 2013 5:10 pm

It was time to update one of our databases today, but I ran into trouble when I tried to deploy the changes through Deployment Manager.

Previous updates with the same DM project have run smoothly, but today's update failed with the following messages in DM's log:

2013-02-22 16:53:43 WARN DM extended properties were not found on the target database. Static upgrade will not be available
2013-02-22 16:53:43 DEBUG Checking for upgrade script at db\\upgrades\\<unknownVersion>\\UpgradeScript.sql
2013-02-22 16:53:43 ERROR Could not upgrade: no upgrade script for current version <unknownVersion> was found and dynamic upgrade has not been enabled (you can enable it by setting the variable allowDynamicDatabaseUpgrade to true)

DM doesn't seem to find the version number of the target database.

What I have done in the past (and that has served me well so far) is to configure the version number in a variable named targetPackageVersion.

Since the last, successful database update we've upgraded DM to v. Therefore it seems to me as DM v. doesn't support the targetPackageVersion variable?

Is this correct? What should I do instead of using that variable?

Posts: 108
Joined: Mon Sep 12, 2011 9:51 am

Postby swinghouse » Fri Feb 22, 2013 5:31 pm

After reading ... ges#o17614 I manually added the extended properties that Deployment Manager requires:

    DeploymentManager Deployed Package ID

    DeploymentManager Deployed Package Version

This took care of my original problem - so far, so good...

However, DM now complains about the pre-deployment state of the target database:

2013-02-22 17:20:47 WARN Schema differences found, validation failed:
2013-02-22 17:20:47 ERROR Pre-deployment validation failed; no changes have been made to the database (you can suppress the check by setting the variable allowPreDeployDatabaseValidation to false)

I know (or do I?) that I haven't made any manual changes to the target database, so I'm a bit puzzled by the results of the pre-deployment validation.


1) Do you have any clue as to why my target database didn't contain the extended properties?

2) Are there any changes in DM v. that could've caused any of my current issues?
Posts: 108
Joined: Mon Sep 12, 2011 9:51 am

Postby swinghouse » Mon Feb 25, 2013 8:26 am

Here's what I did to get back in sync:

1) I updated the target database schema with SQL Compare. (Four tables were missing on the target server.)

2) One of the static data tables were out of sync. SQL Data Compare to the rescue!

3) Now I could deploy the latest database changes with Deployment Manager. I noticed that the extended property "DeploymentManager Deployed Package Version" was correctly updated on the target server this time around.

I suspect I'm responsible for the drift in the table containing static data, but I really can't see how I could've caused the missing tables and the missing extended properties.

Could these issues have been caused by earlier versions of Deployment Manager?

Posts: 108
Joined: Mon Sep 12, 2011 9:51 am

Postby swinghouse » Mon Feb 25, 2013 8:31 am

BTW, the latest version of Deployment Manager, v., behaved in the same way as v.

My take on this is that the latest DM versions work as expected and that my issue was caused by problems in an earlier version of DM.

Posts: 108
Joined: Mon Sep 12, 2011 9:51 am

Postby Emma A » Mon Feb 25, 2013 6:15 pm

Hi Mattias,
At Deployment Manager version and the associated TeamCity plugin, we made several changes to database deployments as you have realised, sorry if these were not made obvious to you.

Now when a datbase is deployed it sets the extended properties that you identified, DeploymentManager Deployed Package ID and
DeploymentManager Deployed Package Version. This is how we are able to detect what version the database is at and idenitify if any changes have occurred.

The TeamCity plugin uses the Deployment Manager details you entered to determine which versions of the package have been deployed. It uses this to create the appropriate upgrade scripts for those deployed versions when you have the generate upgrade scripts option selected. The Deployment Manager targetPackageVersion variable is no longer needed.

When you manually added the extended properties, if you did not give a value or gave a value that did not match a previously deployed version, there may have been differences between the expected version and the state of the database you were trying to upgrade.

So as you realised the extended properties are new, I am afraid I do not know about the missing tables, you could look inside a previous NuGet package that you deployed and see whether there are associated scripts for them but hopefully the new packages are being created correctly and deploying as you would expect.

If you have any questions please get in touch.
Emma A
Posts: 40
Joined: Mon Mar 30, 2009 1:53 pm

Postby swinghouse » Tue Feb 26, 2013 9:08 am

Hi Emma,

Thanks for the reply.

I think I'll focus on getting the affected databases in sync manually and then let Deployment Manager take over from there.

I'll let you know if I run into any similar issues, but I'm quite convinced it'll be smooth sailing from now on.

Posts: 108
Joined: Mon Sep 12, 2011 9:51 am

Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 1 guest