Red Gate forums :: View topic - DM extended properties were not found on the target database
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

DM extended properties were not found on the target database

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
swinghouse



Joined: 12 Sep 2011
Posts: 99

PostPosted: Fri Feb 22, 2013 6:10 pm    Post subject: DM extended properties were not found on the target database Reply with quote

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:

Quote:
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
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 99

PostPosted: Fri Feb 22, 2013 6:31 pm    Post subject: Reply with quote

After reading http://www.red-gate.com/supportcenter/Content/Deployment_Manager/help/1.0/dm_working_with_db_packages#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:

Quote:
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?
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 99

PostPosted: Mon Feb 25, 2013 9:26 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 99

PostPosted: Mon Feb 25, 2013 9:31 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Emma A



Joined: 30 Mar 2009
Posts: 40

PostPosted: Mon Feb 25, 2013 7:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 99

PostPosted: Tue Feb 26, 2013 10:08 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group