Upgrade from Openfire 4.0.1 to Openfire 4.2.3

I had installed non-rpm openfire 4.0.1 with jre bundled, all were 32 bits in /home/tancy/openfire folder. I backup openfire database and stop openfire.

I installed 4.2.3 rpm with jre bundled, 64 bits. I copy conf, plugins and resources folder over. Then i used /etc/init.d/openfire to start and I got below exception. Pls do guide me what steps I need to take for upgrading. Since I copied conf folder over, Openfire 4.2.3 is pointing to my 4.0.1 openfire database.

2018.07.17 02:25:38 ERROR [main]: org.jivesoftware.util.JiveProperties - Unknown column ‘encrypted’ in ‘field list’
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘encrypted’ in ‘field list’
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at $java.sql.Wrapper$$EnhancerByProxool$$5e543476.executeQuery()
at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:415)
at org.jivesoftware.util.JiveProperties.init(JiveProperties.java:89)
at org.jivesoftware.util.JiveProperties.getInstance(JiveProperties.java:65)
at org.jivesoftware.util.JiveGlobals.getProperty(JiveGlobals.java:544)
at org.jivesoftware.util.cache.CacheFactory.(CacheFactory.java:88)
at org.jivesoftware.openfire.XMPPServer.initialize(XMPPServer.java:311)
at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:535)
at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:163)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:102)
at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:53)

When openfire 4.2.3 first booted, it should have noticed the old database schema and attempted to upgrade it. Please review the logs to see if this process failed or maybe even check your database server logs for a failure.

Before I started 4.2.3, I upgrade 4.0.1 database based on resources/database/upgrade/ 23 to 26, one at a time.

When Openfire launches, it checks the database schema version found in the database and then attempts to upgrade the database sequentially for you. You can certainly do this by hand as well, but it is best to let Openfire do this as sometimes there is business logic within Openfire as a part of the upgrade.