As a workaround, in DatabaseUpgradeChecker I added the upgrade path in maps and commented out the database version check with MS code Version, that worked.
@Koushik: while running the jetty server, getting this error: ERROR [utils.db.ScriptRunner] (main:) Error executing: ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by hypervisor' ERROR [utils.db.ScriptRunner] (main:) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'max_hosts_per_cluster' I checked create-schema.sql and "max_hosts_percluster" column is already present in "hypervisor_capabilities" table. Can you pls remove the sql queries which are not required in schema-410to420.sql. Thanks, Sanjay > -----Original Message----- > From: rohityada...@gmail.com [mailto:rohityada...@gmail.com] On Behalf > Of Rohit Yadav > Sent: Tuesday, February 19, 2013 4:10 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: unable to upgrade database to 4.2.0 > > On Mon, Feb 18, 2013 at 11:49 PM, Sanjay Tripathi > <sanjay.tripa...@citrix.com> wrote: > > Hi all, > > > > It seems like CloudStack is not upgrading the database to 4.2.0. > > I checked the DatabaseUpgradeChecker file and the Upgrade410to420() > was missing from "upgradeMap", so I added it but after this, CloudStack > throwing this error: > > "The end upgrade version is actually at 4.2.0 but our management server > code version is at 4.1.0-SNAPSHOT". > > This is because our MS code version is 4.1.0 so CS is not allowing to > > upgrade > database beyond 4.1.0 . > > > > Is there any other way to upgrade the database or we have to change the > MS code version to 4.2.0-SNAPSHOT? > > That is one way to fix it in pom, or if you want to enforce you can change the > target or pkg version in DatabaseUpgraderChecker (make sure you add an > upgrade path in the maps): > String dbVersion = _dao.getCurrentVersion(); > String currentVersion = > this.getClass().getPackage().getImplementationVersion(); > > I'll send out an email to change the version to 4.2.0 now that we've branched > out 4.1 already. > > Regards. > > > > > Regards, > > Sanjay