You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by cpaulson <cp...@aurea.com> on 2014/08/08 16:50:57 UTC

How to restore deleted Jackrabbit Repository directory?

Hi All,

Repository home directory is crashed/deleted. But the DB system configured
with repository still holds its data.

After the crash,  I run the repository again and repository home directory
is restored back. But Workspace that i have created is lost not restored
back.

/*_Repository configuration i have done:_*/

&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!DOCTYPE Repository PUBLIC
"-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
"http://jackrabbit.apache.org/dtd/repository-2.0.dtd"&gt;&lt;Repository&gt;  
&lt;FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">     
&lt;param name="driver" value="oracle.jdbc.OracleDriver" /&gt;     
&lt;param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;     
&lt;param name="user" value="jrabbit" /&gt;      &lt;param name="password"
value="jrabbit" /&gt;      &lt;param name="schema" value="oracle" /&gt;     
&lt;param name="schemaObjectPrefix" value="J_R_FS_" /&gt;  
&lt;/FileSystem&gt;   &lt;DataStore
class="org.apache.jackrabbit.core.data.FileDataStore" /&gt;   &lt;Security
appName="Jackrabbit">      &lt;SecurityManager
class="org.apache.jackrabbit.core.DefaultSecurityManager"
workspaceName="security" /&gt;      &lt;AccessManager
class="com.bpmportal.accessmanager.LDAPAccessManager" /&gt;     
&lt;LoginModule class="com.sun.security.auth.module.LdapLoginModule">        
&lt;param name="userProvider" value="ldap://localhost:10389" /&gt;        
&lt;param name="authIdentity"
value="cn={USERNAME},ou=Users,dc=progress,dc=com" /&gt;         &lt;param
name="useSSL" value="false" /&gt;         &lt;param name="debug"
value="true" /&gt;         &lt;param name="adminId" value="cijopaulson"
/&gt;      &lt;/LoginModule&gt;   &lt;/Security&gt;   &lt;Workspaces
rootPath="${rep.home}/workspaces" defaultWorkspace="default" /&gt;  
&lt;Workspace name="${wsp.name}">      &lt;FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">         &lt;param
name="driver" value="oracle.jdbc.OracleDriver" /&gt;         &lt;param
name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;        
&lt;param name="user" value="jrabbit" /&gt;         &lt;param
name="password" value="jrabbit" /&gt;         &lt;param name="schema"
value="oracle" /&gt;         &lt;param name="schemaObjectPrefix"
value="${wsp.name}_FS_" /&gt;      &lt;/FileSystem&gt;     
&lt;PersistenceManager
class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">        
&lt;param name="driver" value="oracle.jdbc.OracleDriver" /&gt;        
&lt;param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;        
&lt;param name="user" value="jrabbit" /&gt;         &lt;param
name="password" value="jrabbit" /&gt;         &lt;param name="schema"
value="oracle" /&gt;         &lt;param name="schemaObjectPrefix"
value="${wsp.name}_PM_" /&gt;      &lt;/PersistenceManager&gt;     
&lt;SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">        
&lt;param name="path" value="${wsp.home}/index" /&gt;         &lt;param
name="supportHighlighting" value="true" /&gt;         &lt;param
name="enableConsistencyCheck" value="true" /&gt;         &lt;param
name="forceConsistencyCheck" value="true" /&gt;         &lt;param
name="textFilterClasses"
value="org.apache.jackrabbit.extractor.PlainTextExtractor,      
org.apache.jackrabbit.extractor.MsWordTextExtractor,      
org.apache.jackrabbit.extractor.MsExcelTextExtractor,      
org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,      
org.apache.jackrabbit.extractor.PdfTextExtractor,      
org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,      
org.apache.jackrabbit.extractor.RTFTextExtractor,      
org.apache.jackrabbit.extractor.HTMLTextExtractor,      
org.apache.jackrabbit.extractor.XMLTextExtractor" /&gt;     
&lt;/SearchIndex&gt;   &lt;/Workspace&gt;   &lt;Versioning
rootPath="${rep.home}/version">      &lt;FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">         &lt;param
name="driver" value="oracle.jdbc.OracleDriver" /&gt;         &lt;param
name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;        
&lt;param name="user" value="jrabbit" /&gt;         &lt;param
name="password" value="jrabbit" /&gt;         &lt;param name="schema"
value="oracle" /&gt;         &lt;param name="schemaObjectPrefix"
value="Versioning_FS_" /&gt;      &lt;/FileSystem&gt;     
&lt;PersistenceManager
class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">        
&lt;param name="driver" value="oracle.jdbc.OracleDriver" /&gt;        
&lt;param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;        
&lt;param name="user" value="jrabbit" /&gt;         &lt;param
name="password" value="jrabbit" /&gt;         &lt;param name="schema"
value="oracle" /&gt;         &lt;param name="schemaObjectPrefix"
value="Versioning_PM_" /&gt;      &lt;/PersistenceManager&gt;  
&lt;/Versioning&gt;   &lt;SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">      &lt;param
name="path" value="${rep.home}/repository/index" /&gt;      &lt;param
name="supportHighlighting" value="true" /&gt;      &lt;param
name="enableConsistencyCheck" value="true" /&gt;      &lt;param
name="forceConsistencyCheck" value="true" /&gt;      &lt;param
name="textFilterClasses"
value="org.apache.jackrabbit.extractor.PlainTextExtractor,      
org.apache.jackrabbit.extractor.MsWordTextExtractor,      
org.apache.jackrabbit.extractor.MsExcelTextExtractor,      
org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,      
org.apache.jackrabbit.extractor.PdfTextExtractor,      
org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,      
org.apache.jackrabbit.extractor.RTFTextExtractor,      
org.apache.jackrabbit.extractor.HTMLTextExtractor,      
org.apache.jackrabbit.extractor.XMLTextExtractor" /&gt;  
&lt;/SearchIndex&gt;   &lt;!--        Run with a cluster journal    --&gt;  
&lt;Cluster id="node1" syncDelay="2000">      &lt;Journal
class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">        
&lt;param name="revision" value="${rep.home}/revision.log" /&gt;        
&lt;param name="driver" value="oracle.jdbc.OracleDriver" /&gt;        
&lt;param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /&gt;        
&lt;param name="user" value="jrcluster" /&gt;         &lt;param
name="password" value="jrcluster" /&gt;      &lt;/Journal&gt;  
&lt;/Cluster&gt;&lt;/Repository&gt;
U can observe the following things in the above repository configuration:-
&nbsp;&nbsp;&nbsp;- FileSystem and PersistenceManager points to Oracle Db
system
&nbsp;&nbsp;&nbsp;- Repository home directory contains Search Index and etc.

Is there any way to store repository home directory without any loss of
data.

Thanks in advance.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-restore-deleted-Jackrabbit-Repository-directory-tp4661205.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: How to restore deleted Jackrabbit Repository directory?

Posted by cpaulson <cp...@aurea.com>.
Thanks for your reply Alex. 

Let me try out the steps u have mentioned and let you know that.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-restore-deleted-Jackrabbit-Repository-directory-tp4661205p4661454.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: How to restore deleted Jackrabbit Repository directory?

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 08.08.2014, at 07:50, cpaulson <cp...@aurea.com> wrote:

> Repository home directory is crashed/deleted. But the DB system configured with repository still holds its data.
> 
> After the crash, I run the repository again and repository home directory is restored back. But Workspace that i have created is lost not restored back.

Depending on the configuration, there are some vital things stored in the home and workspace dirs, including node types, namespaces, search indexes (inside the workspace). If these have changes compared to the out of the box defaults, they are lost. But maybe you are lucky and most data is in the DB.

But I see you are using the FileDataStore, which by default is under repository/datastore IIRC, if that is really lost, all your binaries (nt:files) will be gone...

When there is no home directory, Jackrabbit will create a plain one, that's not actually "restoring" (since there is no backup to restore from).

For the workspaces, you need to set up a workspace directory plus a workspace.xml for the specific workspace(s) you had. (The <workspace> part in repository.xml is only used as template when you call Repository.createWorkspace() or whatever the name of the API is).

What I would do is:
- make a backup of your DB and everything that's still there (to avoid overwriting it when trying the steps below)
- add the workspace directory with a workspace.xml based on <workspace> and replace the placeholders such as ${wsp.name}
- (you might want to create a new workspace to see how it looks like)
- ensure the settings map to your existing DB
- if still available, restore the file data store at repository/datastore (please check, not sure if that is the default location)
- start Jackrabbit
- the search index should reindex itself from scratch, would block the startup until it's down IIRC
- figure out if you had any custom node types etc., check the logs on errors and/or simply test your application

Good luck!
Alex

Re: How to restore deleted Jackrabbit Repository directory?

Posted by cpaulson <cp...@aurea.com>.
I am a newbie to jackrabbit. can anyone help me to get answer.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-restore-deleted-Jackrabbit-Repository-directory-tp4661205p4661446.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.