Difference between revisions of "Knowledge:Migration from 6.4.4 to 6.4.5"

From OpenKM Documentation
Jump to: navigation, search
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* See [http://issues.openkm.com/changelog_page.php?version_id=84 changelog at Mantis]
+
* See [http://issues.openkm.com/changelog_page.php?version_id=91 changelog at Mantis]
  
 
* Download update from http://openkm.com/download/okm/OpenKM-6.4.5.zip (eMpg8eIjY5)
 
* Download update from http://openkm.com/download/okm/OpenKM-6.4.5.zip (eMpg8eIjY5)
Line 8: Line 8:
  
 
* Run from your preferred SQL client these queries:
 
* Run from your preferred SQL client these queries:
 +
 +
'''MySQL'''
 +
<source lang="sql">
 +
UPDATE OKM_NODE_MAIL SET NML_ATTACHMENT='F';
 +
</source>
  
 
'''HSQL'''
 
'''HSQL'''
Line 26: Line 31:
 
<source lang="bash">
 
<source lang="bash">
 
$ grep "ERROR .*hbm2ddl" $TOMCAT_HOME/logs/catalina.log
 
$ grep "ERROR .*hbm2ddl" $TOMCAT_HOME/logs/catalina.log
</source>
 
 
* Go to Administration > Database Query, and update configuration properties:
 
 
<source lang="sql">
 
 
</source>
 
</source>
  

Latest revision as of 12:10, 13 December 2013

  • Make a backup!!!
  • Stop Tomcat
  • Run from your preferred SQL client these queries:

MySQL

UPDATE OKM_NODE_MAIL SET NML_ATTACHMENT='F';

HSQL

alter table OKM_NODE_MAIL add column NML_ATTACHMENT char(1) DEFAULT 'F' not null
  • Edit OpenKM.cfg and set hibernate.hbm2ddl to update
  • Replace the OpenKM.war
  • Review file descriptor limit and, eventually, increase it.
  • Start Tomcat again
  • Check for database errors:
$ grep "ERROR .*hbm2ddl" $TOMCAT_HOME/logs/catalina.log
  • Go to Administration > Scripting and execute:
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.openkm.dao.HibernateUtil;
import com.openkm.dao.bean.NodeMail;
import com.openkm.dao.bean.NodeDocument;

String qsMail = "from NodeMail";
String qsAttachment = "from NodeDocument nd where nd.parent=:parent";
Session session = null;
Transaction tx = null;

try {
    // Start transaction
    session = HibernateUtil.getSessionFactory().openSession();
    tx = session.beginTransaction();
    
    for (NodeMail nMail : session.createQuery(qsMail).list()) {
        Query qAttachment = session.createQuery(qsAttachment);
        qAttachment.setString("parent", nMail.getUuid());
        nMail.setAttachment(!qAttachment.list().isEmpty());
        session.update(nMail);
    }
    
    // End transaction
    HibernateUtil.commit(tx);
} catch (Exception e) {
    HibernateUtil.rollback(tx);
    print("Error: " + e);
}
  • Enjoy OpenKM 6.4.5!

If you have any weird problem try to stop Tomcat, delete these folders:

  • $TOMCAT_HOME/webapps/OpenKM
  • $TOMCAT_HOME/work/Catalina/localhost

And start Tomcat again.


Nota clasica.png Recommended to clear browser cache and Java Plugin cache