755 vcconf['cubicweb'] = applcubicwebversion |
755 vcconf['cubicweb'] = applcubicwebversion |
756 else: |
756 else: |
757 applcubicwebversion = vcconf.get('cubicweb') |
757 applcubicwebversion = vcconf.get('cubicweb') |
758 if cubicwebversion > applcubicwebversion: |
758 if cubicwebversion > applcubicwebversion: |
759 toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion)) |
759 toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion)) |
760 if not self.config.fs_only and not toupgrade: |
|
761 print '-> no data migration needed for instance %s.' % appid |
|
762 self.i18nupgrade(config) |
|
763 mih.shutdown() |
|
764 return |
|
765 for cube, fromversion, toversion in toupgrade: |
|
766 print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube) |
|
767 # only stop once we're sure we have something to do |
760 # only stop once we're sure we have something to do |
768 if not (CWDEV or self.config.nostartstop): |
761 if not (CWDEV or self.config.nostartstop): |
769 StopInstanceCommand(self.logger).stop_instance(appid) |
762 StopInstanceCommand(self.logger).stop_instance(appid) |
770 # run cubicweb/componants migration scripts |
763 # run cubicweb/componants migration scripts |
771 mih.migrate(vcconf, reversed(toupgrade), self.config) |
764 if self.config.fs_only or toupgrade: |
|
765 for cube, fromversion, toversion in toupgrade: |
|
766 print '-> migration needed from %s to %s for %s' % (fromversion, toversion, cube) |
|
767 mih.migrate(vcconf, reversed(toupgrade), self.config) |
|
768 else: |
|
769 print '-> no data migration needed for instance %s.' % appid |
772 # rewrite main configuration file |
770 # rewrite main configuration file |
773 mih.rewrite_configuration() |
771 mih.rewrite_configuration() |
774 mih.shutdown() |
772 mih.shutdown() |
775 # handle i18n upgrade |
773 # handle i18n upgrade |
776 if not self.i18nupgrade(config): |
774 if not self.i18nupgrade(config): |