Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

moving sonarqube.

how to move data from sonarqube (7.4) on postgres standalone server, to other ubuntu server on docker sonar with postgres?
What i did:
i install sonar with postgres on docker sonar 7.7-community and postgres 11.3
then i take dump of old sonar and restore on new postgres.
it's not work.
Avatar of David Favor
David Favor
Flag of United States of America image

Keep in mind...

Docker is meant more for more ephemeral microservices (no persistent data), as Docker volumes live outside the container. This means backups, scaling (where multiple backing stores must be managed), spinning up dev/staging containers... All this will be very complex with Docker.

LXD is meant for fully bootable, self contained systems, with complex config file setups + databases.

Since you mention PostgreSQL, likely LXD will be your target container system, rather than Docker.

Likely the reason your Docker setup is failing relates to how you've arranged your config files or database files.

With Docker this is massively complex, because you must somehow install your database at the machine level, then refer to the machine level database files via the Docker volume syntax.

This also means Docker is fairly useless for database systems, because when databases are in use you must either only ever install one database at machine level or write your own multi-instance database management system.

My guess is using LXD will allow you must smoother transition than trying to use Docker.

If you do opt for Docker, with the default system database management tools, you must control who has access to the machine level root (package management system + database management system) to ensure your Docker based code survives over a long time.
Note: This comment "i install sonar with postgres on docker sonar 7.7-community and postgres 11.3" likely shows the problem.

With Docker here's how this works... the easy way...

1) You must run a Docker container, which points to some machine level file system, which will only be used by this one Docker instance. Access by any other process, will have a very good chance of destroying your database table data.

2) When your Docker container starts, check to see if you have an empty database + if you do, initialize your data.

Note: Code this carefully, because mistakenly running database initialization repeatedly can destroy your database table data.

3) Next start your application, using both config files + database table data in machine level volume set aside for your container.
Avatar of Jasmin shahrzad
Jasmin shahrzad

ASKER

ok.
I can just observe when i start sonar on docker is missing sonar-properties under conf.
in standalone installation it create one properties file to configure, but it missing under docker and
database cannot allow the user sonar login to database unless we add  'host  all  all  all  trust'  in pg_hb.conf  file.
is it a bug or i missing something.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.