External database

Hello,
Can I use an external database (for example, postgres) instead of h2 for plugin?

Thanks, Olga

Hi Olga,

I’m not sure what you mean with “for plugin”. In most cases the plugin will store its data in the same database as used for Confluence: Database Configuration | Confluence Data Center and Server 8.0 | Atlassian Documentation

Andreas

Hi, Andreas,

I’m working with confluence sdk plugin and running my application on it. I meant sdk plugin. In this way confluence start on embedded h2 database.

I found this link:

But it didn’t help. I’ll try once more.

Olga

I specify properties for plugin:

<plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <instanceId>postgresInst</instanceId>
                    <products>
                        <product>
                            <id>confluence</id>
                            <instanceId>postgresInst</instanceId>
                            <version>${confluence.version}</version>
                            <dataPath>src/main/data/home</dataPath>
                            <dataSources>
                                <dataSource>
                                    <jndi>jdbc/DefaultDS</jndi>
                                    <url>jdbc:postgresql://localhost:5432/confluencemydb</url>
                                    <username>confluencemy</username>
                                    <password>confluencemy</password>
                                    <driver>org.postgresql.Driver</driver>
                                    <libArtifacts>
                                        <libArtifact>
                                            <groupId>postgresql</groupId>
                                            <artifactId>postgresql</artifactId>
                                            <version>9.1-901-1.jdbc4</version>
                                        </libArtifact>
                                    </libArtifacts>
                                </dataSource>
                            </dataSources>
                        </product>
                    </products>
                </configuration>
            </plugin>

Start server:

atlas-mvn clean package amps:run

The confluence started, and I see a screen for selection mode: production or development. I can’t select a data source for development mode, that why I choose the production mode with a temporary license. I don’t see my data source from the plugin and when I restart my server I need to recreate a database, because I can’t select my old settings (I see the start screen with mode selection).

Is another way to specify datasource or I have mistakes in my configuration?

Olga