com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Updating the Existing Datasources

A datasource is a connection set up to a storage of data, i.e., a database or a data file, from a server. A datasource provides information that a server can use to connect to a storage of data. ES only uses the following two datasources: 

DatasourceDescriptionDefinition File Path
WSO2_CARBON_DBThis is used to store data of on the ES registry and user manager to a RDBMS.<ES_HOME>/repository/conf/datasources/master-datasources.xml
WSO2_SOCIAL_DBThis is used to persist Store-side social activities (e.g., comments, rating, likes etc.).<ES_HOME>/repository/conf/datasources/social-datasources.xml 

Updating the existing datasources is the main use case that is applicable when working with ES. However, if you wish to learn more on working with datasources, see Managing Datasources.

Follow the steps below to update the existing datasources:

By default, ES uses the H2 DB. You need to update the existing datasources in ES when you use a DB that differs from the default DB.

  1. Create a database driver.

    1. Download the driver JAR file of the respective RDBMS type.
    2. Copy the driver JAR file to the <ES_HOME>/repository/components/lib directory. 
  2. Update the WSO2_CARBON_DB datasource, which is defined in the <ES_HOME>/repository/conf/datasources/master-datasources.xml file, based on your requirements. For more information, see Datasource Configuration Definition.

  3. Update the WSO2_SOCIAL_DB datasource, which is defined in the <ES_HOME>/repository/conf/datasources/social-datasources.xml file, based on your requirements. For more information, see Datasource Configuration Definition.

  4. Optionally, create a query adapter n ES.
    ES is shipped with query adapters for H2, MySQL, MSSQL and Oracle11g. If you are using a different DB, than the DBs specified above, create a query adapter as follows:

    1. Create a custom query adapter by extending the GenericQueryAdapter and implementing the AdapterInterface.

    2. Create a JAR file for the custom query adapter.

    3. Add the query adapter into the <ES_HOME>/repository/components/lib directory.

  5. Optionally, update the query adapter in the <ES_HOME>/repository/conf/social.xml file. If you are using a DB other than H2 or MySQL, this step is mandatory. 
    By default, ES uses the org.wso2.carbon.social.db.adapter.GenericQueryAdapter query adapter, which is used for H2 and MYSQL. If you are using another DB type, replace the default query adapter with the query adapter that corresponds to your DB. For more information on the available query adapters, see Query adapters shipped with ES.

    <SocialConfig>
    	<QueryAdapterClass>org.wso2.carbon.social.db.adapter.GenericQueryAdapter</QueryAdapterClass>
    </SocialConfig>
  6. Restart the ES server.

Query adapters shipped with ES

ES is shipped with the following query adapters, where org.wso2.carbon.social.db.adapter.GenericQueryAdapter is the default query adapter. 

DB TypeQuery Adapter
H2 org.wso2.carbon.social.db.adapter.GenericQueryAdapter
MySQLorg.wso2.carbon.social.db.adapter.GenericQueryAdapter
MSSQLorg.wso2.carbon.social.db.adapter.MSSQLQueryAdapter
Oracle11gorg.wso2.carbon.social.db.adapter.Oracle11gQueryAdapter
PostgreSQLorg.wso2.carbon.social.db.adapter.GenericQueryAdapter
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.