10-14-2019 07:46 AM
Hi,
I have a running Docker instance of Alfresco Community 6.0 in production and I would like to change the password to connect to the Postgres database.
This seems to be feasible by simply changing the respective variables in the docker-compose.yml file, that is:
Ddb.username Ddb.password POSTGRES_PASSWORD
However, I was wondering if by doing this the Share application will no longer be able to access the database, i.e. existing accounts will no longer work.
I've tried this in a test environment (by first rebuilding and recreating the composition), and I was no longer able to access with the admin account.
Since the database and content library hasn't yet been populated that much (and also existing users are few), maybe I should just recreate everything and restore the backup?
Many thanks.
10-15-2019 12:21 AM
Grate, you do all right.
docker-compose down stops and remove all conteiners. docker-compose up create new and start all containers. docker-compose stop <service> stops the exact service.
Again:
1. Stop all containers exept database.
sudo docker-compose stop share sudo docker-compose stop solr6 sudo docker-compose stop ... sudo docker-compose stop alfresco
2. Change database password
3. Stop and remove all docker-compose instances.
sudo docker-compose down
4. Edit password into alfresco-global properties and into docker-compose.yml
5. Make shure update alfresco-global.properties in your alfresco image or connect updated alfresco-global.properties to alfresco container. It depends of your docker-compose.yml configuration and your Dockerfile-s. I don't see it and can't give exact recomendations.
6. Restart docker compose by
sudo docker-compose up
Besides it's very important in production to clearly understand the docker-compose: images / conteiners / services / volumes / network.
10-14-2019 10:27 AM
Share only accesses the repository application which in turn accesses the database. Are you familiar with starting and stopping containers? This is possible, but there are some nuances.
10-14-2019 11:49 AM
Hi, thanks.
I'm new to Docker, I usually stop all containers with
docker-compose down
and start them all up again with
docker-compose up --force-recreate
I guess I could just stop/start invididual containers with docker-compose stop/start.
Should I first stop only the database container with changed password and then start it again? Should I also edit the alfresco-global.properties config file, rather than just the YAML file?
Thanks again for your help.
10-14-2019 11:58 AM
Production envoriment must have named volumes for at least: alfresco repository, solr indexes and database. All data will stored into hosts folders independently of docker containers. So rebuilding and restarting of containers don't influens on data.
DB password present in alfresco-global.properties and docker-compose.yml. So as I understend theoreticaly you should:
I give you only the way to go on.
10-14-2019 01:07 PM
The environment does indeed have named volumes mounted on the host for alf repo, solr and database data. The data seem to be stored there correctly.
I'll try running psql to change the password by executing it in the container through docker.
When you say "rebuild containers" do you mean "docker-compose build" for indivudal containers?
Could I rebuild and restart everything by doing the following?
docker-compose up --build --force-recreate
Many thanks for your help.
Explore our Alfresco products with the links below. Use labels to filter content by product module.