Preparing the PostgreSQL Database for Installation
Codebeamer (Emma or higher) supports PostgreSQL (for details, refer Codebeamer release specific requirements) and for some optional and performance improving features requires the contrib extensions. In some cases this needs to be installed separately; for example on some Linux distributions like CentOS. Since Codebeamer release 2.1 (IMPALA), the built-in PostgreSQL database setup option is no longer available in the Codebeamer installation wizard.
IMPORTANT: Backup your data! Before doing anything, backup your existing database. Also ensure that during migration nobody uses the database, because it may cause loss of data.
Windows, Unix, MAC-OS
Downloading and installing the PostgreSQL database is not part of this document. Refer to PostgreSQL for instructions.
Linux
Install PostgreSQL via your distribution's package manager. By some distributions the additional contrib extensions reside in a separate package. It is recommended to install this as well to enable some optional and performance improving features.
We highly recommend using the same version that Codebeamer was tested on. You can find this version in the release notes of the current version.
See also: Installing PostgreSQL on Linux
PostgreSQL Configuration
When installing PostgreSQL, be sure to set and remember a sensible root password.
Ensure that the following settings are configured in your database. You can find these settings in postgresql.conf, that typically resides in the PostgreSQL data directory (e.g. in Windows: C:\Program Files\PostgreSQL\12\data\postgresql.conf, or Linux/Unix: /var/lib/postgresql/data/postgresql.conf (or /etc/postgresql/12/main/postgresql.conf), or MAC-OS: /usr/local/var/postgres/postgresql.conf).
effective_io_concurrency = 200
jit = on
max_locks_per_transaction = 5000
random_page_cost = 1.1
temp_buffers = 64MB
work_mem = 80000
default_statistics_target = 1000
checkpoint_timeout = 2700
It might be useful checking this https://pgtune.leopard.in.ua page.
Creating the Database
In case of new a installation, the following steps are automatically performed by the Codebeamer Wizard, therefore, no manual action is needed.
Prepare the Codebeamer PostgreSQL Database
In this step we assume the PostgreSQL is running on the default 5432 port.
In order for Codebeamer to access a PostgreSQL database, an appropriate database schema and user have to be prepared. You can use any username and password instead of the cbroot and cbpassword used below:
- Open a command prompt (on Windows execute "cmd") and go into your $POSTGRESQL_HOME$/bin directory (for example in Windows it could be C:\Program Files\PostgreSQL\12\bin).
- Execute the command: psql -U postgres. When asked, provide it with the password which was configured during installation.
- Execute commands (if running Postgres on Windows Server use en_US character collation instead of en_US.UTF-8):
CREATE DATABASE codebeamer LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' ENCODING 'UTF8' TEMPLATE = template0;
CREATE USER cbroot WITH PASSWORD 'CbPassword01!';
ALTER DATABASE codebeamer OWNER TO cbroot;
- In case PostgreSQL's contrib package is also installed, execute the following:
\c codebeamer
CREATE EXTENSION pg_trgm;
Configure Codebeamer to Use the PostgreSQL Database
Edit/create the configuration file: <cb-installation-dir>/config/configuration.properties
database.driver=org.postgresql.Driver
database.connectionURL=jdbc:postgresql://localhost:5432/codebeamer
database.username=cbroot
database.password=CbPassword01!
database.passwordStorageType=PLAIN
Start Codebeamer
Note that after switching to a new database, the initial Codebeamer server start will take longer than usual, because Codebeamer will first initialize the new empty database schema.
Full-Text Index on TASK table
This feature is optional and requires the PostgreSQL contrib extensions installed on the database server. By some distributions (for example CentOS) these reside in a separate package and needs to be installed separately.
For more information about the database specific configuration process, see: Database Specific Configurations - PostgreSQL.