• Unable to take backup of OKM repository

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #45213  by skgoel
 
Hi

One of our folders has an apostrophe in the folder name (API's). Due to this apostrophe, the backup process initiated through the Admin section errors out with pathNotFoundException. I think it is unable to handle the apostrophe. I am unable to delete the folder.

How can I change the name of the folder and/or take the backup of the repository?

Thanks
 #45215  by jllort
 
In this documentation section we talk about how doing backup https://docs.openkm.com/kcenter/view/ok ... store.html ( at least what should consider for it ).

For changing a document name, should execute something like it:
Code: Select all
UPDATE OKM_NODE_DOCUMENT SET NBS_NAME='renamed' where NBS_UUID='SOME DOCUMENT UUID';
To find the document uuid should take a look at all documents what it have this character ( THE DOUBLE '' IS SINGLE ' IN SQL ):
Code: Select all
SELECT * FROM OKM_NODE_DOCUMENT WHERE NBS_NAME LIKE = '%''%'; 
What OpenKM version are you using, because in the last OpenKM this issue should be solved, might be you have missed some step while upgrading ?

You can also try with this script:
Code: Select all
import org.hibernate.*;
    import com.openkm.dao.*;
    import com.openkm.dao.bean.*;

    Session session = null;
    Transaction tx = null;

    try {
      session = HibernateUtil.getSessionFactory().openSession();
      tx = session.beginTransaction();
      Query q = session.createQuery("from NodeBase nb where nb.name like '%''%'"); // The ' character

      for (NodeBase nBase : q.list()) {
        print(nBase.uuid + "<br/>");
        nBase.name = nBase.name.replaceAll("'", "").trim();
        session.update(nBase);
      }

      HibernateUtil.commit(tx);
    } catch (HibernateException e) {
      HibernateUtil.rollback(tx);
    } finally {
      HibernateUtil.close(session);
    }

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.