DM extended properties were not found on the target database

swinghouseswinghouse Posts: 120 Bronze 2
edited February 26, 2013 4:08AM in Deployment Manager
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. 1.0.16.10. Therefore it seems to me as DM v. 1.0.16.10 doesn't support the targetPackageVersion variable?

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

/Mattias

Comments

  • After reading http://www.red-gate.com/supportcenter/C ... 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.

    Questions:

    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. 1.0.16.10 that could've caused any of my current issues?
  • swinghouseswinghouse Posts: 120 Bronze 2
    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?

    /Mattias
  • swinghouseswinghouse Posts: 120 Bronze 2
    BTW, the latest version of Deployment Manager, v. 1.0.20.3, behaved in the same way as v. 1.0.16.10.

    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.

    /Mattias
  • Hi Mattias,
    At Deployment Manager version 1.0.20.3 and the associated TeamCity plugin 1.0.0.763, 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.
  • swinghouseswinghouse Posts: 120 Bronze 2
    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.

    /Mattias
Sign In or Register to comment.