Switching between repositories

I've already set up multiple repositories with single Nuxeo instance and my question is how to switch between them? In my nuxeo.conf file I have: nuxeo.templates=default,custom but after login I am always redirected to the default one. I would like to have 2 repos working at the same time and also an option that enables me to choose one of them.

I've got no errors in logs. This is what I did yet:

  1. I've created secondary-repository-config.xml with content like this:

    <clustering enabled="${repository.clustering.enabled}" delay="${repository.clustering.delay}" />
    <binaryStore path="C:\\Programy\\Nuxeo DM\\nuxeo-cap-5.5-tomcat\\nxserver\\data2\\binaries" />
      <field type="largetext">note</field>
      <field type="largetext">relatedtext</field>
      <field type="largetext">webp:content</field>
      <field type="largetext">webc:welcomeText</field>
      <field type="largetext">comment:comment</field>
      <field type="largetext">post</field>
      <field type="largetext">mail:mail</field>
      <!-- for H2 (Lucene Analyzer): -->
      <fulltext analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer">
        <index name="secondary">
          <!-- all props implied -->
        <index name="title">
        <index name="description">
    <property name="ServerName">localhost</property>
    <property name="PortNumber">5432</property>
    <property name="DatabaseName">secondary</property>
    <property name="User">nuxeo</property>
    <property name="Password">nuxeo</property>

  2. I've put this xml in NUXEO_HOME/templates/custom/nxserver/config

  3. In nuxeo.conf I've set nuxeo.templates=default,custom

  4. I've created proper datababase with PostgreSQL

  5. I am working with Tomcat distribution (v 5.5). Both of my repos are PostgreSQL, each of them has its own database.

0 votes

2 answers



Check what is actually deployed after startup in NUXEO_HOME/nxserver to know if the templates are taken into account correctly.

After deployment secondary-repository-config.xml appeared in NUXEO_HOME/nxserver/config and new repo is created in NUXEO_HOME/nxserver/repos/secondary. But after login I'm not redirected do http://localhost:8080/nuxeo/nxpath/default@view_servers. When I manually reach this url using breadcrumbs navigation, I still can only see "Default Repository (default)". I've also checked content of the database but no tables were created.

I moved your next question into an another question.

You can choose the repository with the following URL: http://yourserver/nuxeo/nxpath/default@view_servers which is accessible from the breadcrumbs navigation, clicking on the left arrow. But if you're logging in as an administrator user, you should be redirected to this view after login.

If the only item you see on this page is the default repository, then you may have a configuration issue: please comment your post to give more information about what you did, and check if you have any errors in logs.

3 votes

One small change - I've put secondary-repository-config.xml in NUXEO_HOME/templates/custom/config instead of NUXEO_HOME/templates/custom/nxserver/config. New repo appeaed in NUXEO_HOME/nxserver/repos but http://yourserver/nuxeo/nxpath/default@view_servers does not enable me to choose repository.

I found out that there is one more thing to do while setting up multiple repositories. I just had to contribute “repositories” extension point, just like this:

<component name="com.nuxeo.multi.repository">
    <extension target="org.nuxeo.ecm.core.api.repository.RepositoryManager"
        <repository name="secondary" label="Secondary Repo" />

Everything seems to work fine, after login I'm able to choose repo.

1 votes

Yes for historical reasons there are two repository registries that must be filled to declare a repository. We'll simplify this in the future.