Upgrade problem

I’m attempting to upgrade an installation from Openfire 3.3.2 to 3.6.4. The data is held in a MySQL database. When attempting to start I get the messages:


Found old database version 10 for openfire. Upgrading to version 20…
Database setup or configuration error: Please verify your database settings and check the logs/error.log file for detailed error messages.
java.lang.IllegalArgumentException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table ‘openfire.ofid’ doesn’t exist
at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:710)
at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:427)
at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:161)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.jivesoftware.openfire.starter.ServerStarter.start(ServerStarter.java:106)
at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table ‘openfire.ofid’ doesn’t exist
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1467)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at $java.sql.Wrapper$$EnhancerByProxool$$518616e5.executeQuery()
at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:700)
… 16 more
Error starting the server. Please check the log files for more information.
Server halted

I thought that the database schema gets upgraded automatically…?

Here’s a list of tables in my DB:

mysql> use openfire
Database changed
mysql> show tables;
±---------------------+
| Tables_in_openfire |
±---------------------+
| jiveextcomponentconf |
| jivegroup |
| jivegroupprop |
| jivegroupuser |
| jiveid |
| jiveoffline |
| jivepresence |
| jiveprivacylist |
| jiveprivate |
| jiveproperty |
| jiveremoteserverconf |
| jiveroster |
| jiverostergroups |
| jivesaslauthorized |
| jiveuser |
| jiveuserprop |
| jivevcard |
| jiveversion |
| mucaffiliation |
| mucconversationlog |
| mucmember |
| mucroom |
| mucroomprop |
| pubsubaffiliation |
| pubsubdefaultconf |
| pubsubitem |
| pubsubnode |
| pubsubnodegroups |
| pubsubnodejids |
| pubsubsubscription |
±---------------------+
30 rows in set (0.02 sec)

Thanks,

Michael

Maybe you should do one version at a time upgrade. http://www.igniterealtime.org/community/docs/DOC-1270

Though maybe you can skip some of them, like 3.4.0 -> 3.5.0 -> 3.6.0

It turns out that the problem was caused by my DB having a jivepresence table. The 10 -> 11 upgrade script attempts to create this and if it already exists then the whole upgrade fails. I removed this table and then was able to upgrade directly from 3.3.2 to 3.6.4.

I’m not sure why there was a jivepresence table - maybe as the result of a previous botched upgrade attempt!