Page 1 of 1

Merging two repositories

PostPosted:Sun Mar 19, 2017 2:50 pm
by openkm_user
Hi,

We have 2 instances of tomcat, we started with bundled tomcat and have documents in that repository. But due to the compliance we follow we installed another newer version of tomcat and started importing documents in there now. So we have 2 repositories and would like to have repo from bundled tomcat in the newer tomcat. I think we will not have any problem restoring datastore but how to do the index?

Thanks in advance!

Re: Merging two repositories

PostPosted:Mon Mar 20, 2017 9:22 am
by jllort
Migration between two OpenKM ? or migrate only the tomcat version ?

Re: Merging two repositories

PostPosted:Mon Mar 20, 2017 11:31 am
by openkm_user
Let me try and explain.

We started off with the openkm bundled tomcat version and the client imported about 250,000 documents in this instance.
Our client forced us to upgrade to tomcat 8.x due to compliance reasons. We spun up an 8.x instance of tomcat and then the client imported about 100,000 documents in this 8.x version. However we ran into a bug in this 8.x version and had to roll back to a 7.0.59 apache tomcat version which satisfies the client compliance and also overcomes the 8.x bug.

Now we want to take the 250K documents that sit in the bundled tomcat, the 100K 8.x tomcat and merge it into the 7.0.59 version that we are currently running.

I believe we can merge the datastore folder without conflicts because the folders and filenames will be unique. or are we mistaken?

But what about the indexes? Is there any way to just recreate the indexes after merging the datastore folders?

Thank you

Re: Merging two repositories

PostPosted:Tue Mar 21, 2017 7:09 pm
by jllort
Not possible this kind of merge, you are forgetting the database data. In this scenario will be necessary export and import. What is possible is migrate the repository from one tomcat to another, but what is not possible is to merge two distinct repositories.

Re: Merging two repositories

PostPosted:Wed Mar 22, 2017 6:11 am
by pavila
Documents and folders are unique and it's pretty sure you won't have collisions. The process would be this:

* Export the old OpenKM repository (Administration > Repository export)
* Copy the exported repository to the new location
* Import the documents into a new folder in the new OpenKM instance (Administration > Repository import)

You don't need to force a repository re-indexing.

Regards.

Re: Merging two repositories

PostPosted:Wed Mar 22, 2017 1:13 pm
by openkm_user
I am sorry but I left out one important piece of information. ALL the three tomcat instances were pointing to the same db repository EVEN THOUGH the tomcat instances were different. Our understanding is that when we import a file it is given a unique name and folder structure and stored in the repository. Then an entry is made in the db pointing to this unique name. So all the files we imported (whatever the running tomcat instance was) have entries in the db that point to a repository. The problem is that the files are in the different repository folders.

For ex: The following is the location of the repository under the various tomcats.

Tomcat --> e:/tomcat/repository
Apache 7.0.59 --> e:/Apache 7.0.59/repository
Apache 8.0.11 --> e:/Apache 8.0.11/repository

So in theory since the db entries don't store the path but only the unique file name if we MOVE the files to the repository that is in the current running tomcat it should work fine. Please correct me if I am wrong.

The only issue will then be the index. Will re-indexing fix the indexes?

Thank you!

Re: Merging two repositories

PostPosted:Wed Mar 22, 2017 1:31 pm
by pavila
It's a quite mysterious installation. If you want 3 OpenKM pointing to the same DB the also have to share the document repository (GlusterFS, NFS, etc) otherwise it won't work. If you have the documents spread by the 3 OpenKM installation you can join them into a big one. You should no have collisions but a previous backup is always recommended (you know: just is case).

Regards.