I am running GOCD in a Docker environment, I was able to Enable GOCD with Postgres database
FROM gocd/gocd-server:v21.3.0
COPY --chown=go:root ./db.properties ./godata/config/db.properties
DockerFile Line 1 - I was pulling the latest stable image from Dockerhub
DockerFile Line 2 - copying db.properties to /godata/config/
db.properties
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://<hostname>:5432/<db_name>
db.user=<postgres-dbuser>
db.password=<password-dbpassowrd>
And creating the database on Postgres container using below sql command
CREATE ROLE "gocd_database_user" PASSWORD 'gocd_database_password' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
CREATE DATABASE "cruise" ENCODING="UTF8" TEMPLATE="template0";
\connect cruise
GRANT ALL PRIVILEGES ON DATABASE "cruise" TO "gocd_database_user";
ALTER ROLE "gocd_database_user" SUPERUSER;
Note: Postgres is running as a separate container with persistent volume
After running gocd-server,gocd-agent, and Postgres as separate containers I was able to create pipelines and it was success
and pipeline,agent information is stored on the tables pipelines and agents
What I expect to happen
When I try to recreate the gocd-server and gocd-agent then all the pipelines are stored on the table should be taken from the existing postgres database
What happened
No pipelines are getting displayed on gocd-server from the database even though the data are present on the table, but the agents are getting restored and displayed on the Agents tab
Note: Since new agents is created old agents get lost contact but that information getting displayed on the gocd-server UI
Refer to image-1 for tables created on Postgres
Refer to image-2 for the pipeline created on the gocd-server
Refer to image-3 for agents up the gocd-server
Refer to image-4 for pipeline and agents stored on the table
Refer to image-5 for agents which gets restored from database which has new and old agent
Refer to image-6 for no pipeline showing on the gocd-server UI
Refer gocd-server-logs.txt for gocd-server logs
Please let me know why pipeline information is not getting restored
Thanks & Regards