cloudbeaver
cloudbeaver copied to clipboard
How to change default h2 database to postgresql?
Hello friends, a question: How can I change the default database h2 Database Engine to postgresql database in cloudbeaver
The way to change the database is described in this article.
I'm sorry, the link was wrong. Here is the correct one https://github.com/dbeaver/cloudbeaver/wiki/Server-configuration#database-configuration.
@kseniaguzeeva,
Can you help me verifying the new configuration that I want to make from h2 to postgresql as indicated in the image, can you tell me if it is ok or not?
Is it necessary to add the username and password?
attached files NEW POSTGRESQL DATABASE CONFIGURATION.txt CURRENT H2 DATABASE CONFIGURATION.txt
Here you can see the config example:
{ "server": { "serverName": "test", "serverURL": "http://localhost:8978", "expireSessionAfterPeriod": 1800000, "database": { "driver": "postgres-jdbc", "url": "jdbc:postgresql://your_local_host/cb", "user": "user_name", "password": "user_password" } } }
The command example to run the instance is
docker run --name docker_name --rm -ti -p 8978:8978 --add-host=host.docker.internal:your_local_host -v way_to_local_configuration:/opt/cloudbeaver/workspace dbeaver/cloudbeaver:cloudbeaver_version
@kseniaguzeeva
thanks for the example but my idea was to modify the base from the backend side and not by a command.
Me podria indicar cual es la carpeta donde debo modificar?
How can I modify the default h2 database to postgresql through the backend?
@kseniiaguzeeva , I tell you that I managed to change the configuration of the default database H2 that is by default to postgresql. I do this in the build files that are in the deploy
, I understand that the files that are in the deploy
are generated using the command
cd cloudbeaver/deploy
./build.sh
@kseniiaguzeeva Could you please tell me in which part of the source code I have to add or modify this configuration, so that it is configured permanently, since as I make the configuration in the configuration files, the configuration will surely be restored once I execute the command ./build.sh
FILE CONFIGURATION DEPLOY cloudbeaver.conf
file path: cloudbeaver/deploy/cloudbeaver/conf/cloudbeaver.conf
{
server: {
serverPort: 8978,
workspaceLocation: "workspace",
contentRoot: "web",
driversLocation: "drivers",
rootURI: "/",
serviceURI: "/api/",
productConfiguration: "conf/product.conf",
expireSessionAfterPeriod: 1800000,
develMode: false,
enableSecurityManager: false,
database: {
driver="postgres-jdbc",
url: "jdbc:postgresql://localhost:5432/postgres-milton",
user: "postgres",
password: "postgres",
createDatabase: true,
initialDataConfiguration: "conf/initial-data.conf",
pool: {
minIdleConnections: 4,
maxIdleConnections: 10,
maxConnections: 100,
validationQuery: "SELECT 1"
}
}
},
app: {
anonymousAccessEnabled: true,
anonymousUserRole: "user",
supportsCustomConnections: false,
forwardProxy: false,
publicCredentialsSaveEnabled: true,
adminCredentialsSaveEnabled: true,
resourceManagerEnabled: true,
resourceQuotas: {
dataExportFileSizeLimit: 10000000,
resourceManagerFileSizeLimit: 500000,
sqlMaxRunningQueries: 100,
sqlResultSetRowsLimit: 100000,
sqlResultSetMemoryLimit: 2000000,
sqlTextPreviewMaxLength: 4096,
sqlBinaryPreviewMaxLength: 261120
},
enabledAuthProviders: [
"local"
],
disabledDrivers: [
"sqlite:sqlite_jdbc",
"h2:h2_embedded",
"clickhouse:yandex_clickhouse"
]
}
}
run cloudbeaver project in eclipse "RUN -> RUN CONFIGURATIONS -> CloudbeaverServer.product -> RUN "
Console:
automatic table creation
@miltonchirinos44 Hi, you can change cloudbeaver/config/sample-databases/DefaultConfiguration/cloudbeaver.conf
@alexander-skoblikov Thanks I managed to solve the problem