Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. the internal storage
  2. your 1.01.X project's (the one created from archetype) sources
  3. configured bundles and logs directories
  4. Save Notification "about" and "recipients", upgrade sets default values for these fileds due to radical change to Notification object from 1.1.X to 1.2.X.

The new 1.2.X project

  1. create a new 1.2.X project
  2. copy any existing Java class you have developed for the former 1.1.X project and make necessary adaptations
  3. include any connector bundle you might have added in the former 1.1.X project
  4. configure the internal storage as done for the former 1.1.X project

...

An example of such changes is reported for MySQL and PostgreSQL (this file is also included in the attached sample for MySQLresources of core-upgrader module of the project): the set of SQL statements you need to run vary depending on the DBMS used for internal storage. During manual SQL upgrade you may see some exceptions (given by DBMS) about deletion of not-existing indexes or views, these aren't blocking exceptions; you only need to be sure to delete all indexes and views, in some cases you may need to change a little bit given SQL samples. 

Due to some DBMS permission and table access policies, it's recommended to execute SQL scripts as the user who accesses syncope database, indicated in syncope data source defined in container configuration.

Change content.xml leaving only new Entitlements

This procedure is highly recommended if using PostgreSQL database, but it's good practice to use it for all DBMS.

Change new 1.2.X project content file, located under core/src/main/resources/content.xml: you have to edit Entitlements section only, comment out (or delete) old entitlements (the ones already present in 1.1.X) leaving only new Entitlements introduced with 1.2.X version. Other "old" Entitlements are already stored on database.

Below there is the list of Entitlements introduced with 1.2.X version:

  • SCHEMA_LIST
  • ROLE_LIST
  • RESOURCE_LIST
  • CONFIGURATION_EXPORT
  • CONFIGURATION_SET
  • SECURITY_QUESTION_LIST
  • SECURITY_QUESTION_READ
  • SECURITY_QUESTION_CREATE
  • SECURITY_QUESTION_UPDATE
  • SECURITY_QUESTION_DELETE

Enable ContentUpgrader

  • In coreIn core/src/main/resources/persistenceContextcoreContext.xml add xml add (at the end of file) before </beans>:

    Code Block
    languagexml
    <import resource="classpath*:upgradeContext.xml"/>
  • In core/pom.xml add following dependency from core-upgrader module:

    Code Block
    languagexml
    <dependency>
      <groupId>org.apache.syncope</groupId>
      <artifactId>core<artifactId>syncope-core-upgrader</artifactId>
      <version>${projectsyncope.version}</version>
    </dependency>
  • Again in In core/pom/src/main/resources/log4j2.xml add resource after <resources> tag as followsfollowing lines:

    Code Block
    languagexml
    <resource>
      <directory>../core-upgrader/src/main/resources</directory>
      <filtering>true</filtering>
      <includes>
        <include>upgradeApplicationContext.xml</include>
      </includes>
    </resource><appenders>
    ...
    ...
    	<RollingRandomAccessFile name="upgrader" fileName="${log.directory}/core-upgrader.log"
                                 filePattern="${log.directory}/core-upgrader-%d{yyyy-MM-dd}.log.gz"
                                 immediateFlush="false" append="true">
    		<PatternLayout>
        		<pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
        	</PatternLayout>
        	<Policies>
        		<TimeBasedTriggeringPolicy/>
            	<SizeBasedTriggeringPolicy size="250 MB"/>
        	</Policies>
    	</RollingRandomAccessFile>
    ...
    ...
    </appenders>
    
    <loggers>
    ...
    ...
        <asyncLogger name="org.apache.syncope.upgrader" additivity="false" level="INFO">
          <appender-ref ref="upgrader"/>
        </asyncLogger>
    ...
    ...
    </loggers>

Build, deploy and run

This first run should succeed without logging any exceptionBuild project, deploy to choosen container and run it. The first run should log exceptions about ContentInitializer (in particular about creation of resources, connectors, etc), but this is normal.

You should now have full access to all Syncope features.Syncope 1.2.X features and at this point Syncope is fully-working and container has no need to be restarted.

Nevertheless is recommended to deploy again Syncope (upgraded) project without core-upgrader dependency and modified persistenceContext.xml, in fact if container is started with "enabled" core-upgrader, some exceptions will be noticed due to failure of upgrade task; but despite this few exceptions (after restart) no persistent changes are made to Syncope 1.2.X and it remains in a solid and working state.

Therefore following steps are optional (but recommended): 

Stop the JEE container <version>${project.version}</version>and follow steps below.

 

Note
titleMigration Warning

If during the upgrade process, MySQL returns an "Incorrect string value", take 'utf80 out of the JDBC URLS, in the datasource configuration.

Disable ContentUpgrader

In core/src/main/resources/persistenceContext.xml remove last import:

Code Block
languagexml
<import resource="classpath*:upgradeContext.xml"/>

and from core/pom.xml remove dependency from core-upgrader added two steps before.

Build, deploy and run

This final run should log no exceptions and you can enjoy all Syncope 1.2.X new amazing features!