Database and Configuration files cleanup
Scrubbing the database is advised when you wish to keep the services installed but want to have a clean copy of the database.
PostgreSQL database cleanup
Use the following SQL queries to cleanup the database for all the services.
--Discovery Service
DROP SCHEMA IF EXISTS discovery CASCADE;
DROP TABLE IF EXISTS public.discovery_databasechangelog CASCADE;
DROP TABLE IF EXISTS public.discovery_databasechangeloglock CASCADE;
DROP USER IF EXISTS discovery_user;
--Publish Service
DROP SCHEMA IF EXISTS publish CASCADE;
DROP TABLE IF EXISTS public.publish_databasechangelog CASCADE;
DROP TABLE IF EXISTS public.publish_databasechangeloglock CASCADE;
DROP USER IF EXISTS publish_user;
--Deployer Service
DROP SCHEMA IF EXISTS deployer CASCADE;
DROP TABLE IF EXISTS public.deployer_databasechangelog CASCADE;
DROP TABLE IF EXISTS public.deployer_databasechangeloglock CASCADE;
DROP USER IF EXISTS deployer_user;
--Distribution Service
DROP SCHEMA IF EXISTS distribution CASCADE;
DROP TABLE IF EXISTS public.distribution_databasechangelog CASCADE;
DROP TABLE IF EXISTS public.distribution_databasechangeloglock CASCADE;
DROP OWNED BY distribution_user;
DROP USER IF EXISTS distribution_user;
--Content Service
DROP SCHEMA IF EXISTS content CASCADE;
DROP TABLE IF EXISTS public.content_databasechangelog CASCADE;
DROP TABLE IF EXISTS public.content_databasechangeloglock CASCADE;
DROP USER IF EXISTS content_user;
--Drop all existing publication schemas
DROP SCHEMA IF EXISTS publication_schema_name CASCADE;
--Drop all users who own publication schemas (similar to j123456789*)
DROP USER IF EXISTS publication_schema_user_name;
Deployer configuration cleanup
Perform the following steps to clean up the configuration files for the Deployer service.
- Edit the cd_storage_conf.xml file located at
[LCC_home]/deployer-service/config- In the <Storages/> element, do NOT delete the default <Storage> sub-element. The following is an example of the default <Storage> element.
<Storage Class="com.tridion.storage.persistence.JPADAOFactory" Id="defaultdb" Timestamp="2023-10-30T10:27:49.365746200Z" Type="persistence" defaultStorage="true" dialect="POSTGRESQL"> <Pool AcquireRetryAttempts="5" Type="jdbc" connectionTimeout="${spring.datasource.connection-timeout}" keepaliveTime="${spring.datasource.keepalive-time}" maxLifetime="${spring.datasource.max-lifetime}" maximumPoolSize="${spring.datasource.maximum-pool-size:-10}" poolName="HikariPool-storage"/> <DataSource Class="org.postgresql.ds.PGSimpleDataSource"> <Property Name="serverName" Value="${spring.datasource.host}"/> <Property Name="portNumber" Value="${spring.datasource.port}"/> <Property Name="databaseName" Value="${spring.datasource.database}"/> <Property Name="user" Value="${spring.datasource.username}"/> <Property Name="password" Value="encrypted:ZqeQ91bag9AirQhpl5Bl6Q=="/> <Property Name="currentSchema" Value="${spring.datasource.schema-name}"/> </DataSource> </Storage> - In the <Storages/> element, delete any <Storage> sub-elements that were created for your publication. The following is an example of <Storage> element for Id="col53_pub532":
<Storage Class="com.tridion.storage.persistence.JPADAOFactory" Id="col53_pub532" Timestamp="2023-10-30T10:27:49.365746200Z" Type="persistence" defaultStorage="true" dialect="POSTGRESQL"> <Pool AcquireRetryAttempts="5" Type="jdbc" connectionTimeout="${spring.datasource.connection-timeout}" keepaliveTime="${spring.datasource.keepalive-time}" maxLifetime="${spring.datasource.max-lifetime}" maximumPoolSize="${spring.datasource.maximum-pool-size:-10}" poolName="HikariPool-storage"/> <DataSource Class="org.postgresql.ds.PGSimpleDataSource"> <Property Name="serverName" Value="${spring.datasource.host}"/> <Property Name="portNumber" Value="${spring.datasource.port}"/> <Property Name="databaseName" Value="${spring.datasource.database}"/> <Property Name="user" Value="${spring.datasource.username}"/> <Property Name="password" Value="encrypted:ZqeQ91bag9AirQhpl5Bl6Q=="/> <Property Name="currentSchema" Value="${spring.datasource.schema-name}"/> </DataSource> </Storage>
- In the <Storages/> element, do NOT delete the default <Storage> sub-element. The following is an example of the default <Storage> element.