Schema used for SelectZero must not contain any tables, as these will be automatically created
Username - postgres database user
Password - postgres database password
tip
If application fails to connect to Postgres database on startup, it will be reverted to SQLite
PostgreSQL user DB requirements
We recommend creating a new separate database for SelectZero alongside with separate user and schema. The user must have all rights in selected schema
Sample creation scripts:
-- Create new empty databaseCREATEDATABASE selectzero;-- Create application userCREATEUSER selectzero_user WITH PASSWORD 'your_secure_password';-- Make sure next commands are run in selected database context-- Create empty schema for application userCREATESCHEMA selectzero AUTHORIZATION selectzero_user;-- Set created schema as default path (by default it will be 'public')ALTER ROLE selectzero_user SET search_path TO selectzero;
Migrating SQLite to PostgreSQL
tip
Note: pgloader does not support setting default schema, so the user's default schema must match our target schema
It is possible to migrate existing SQLite database to a PostgreSQL database using pgloader (installing pgloader). Before migration, make sure you have created the needed DB user following instructions
Create backup of SQLite database and download the database file
Restart the application (the application will be deployed on empty schema, creating necessary tables automatically. This means the database will initially be empty)
Create file selectzero.load with content:
LOADDATABASEFROM sqlite:///path_to_your_backup/backup_file_name.dbINTO postgres://username:password@postgres_url:5432/postgresWITHtruncate,data only
INCLUDING ONLY TABLE NAMES LIKE'tt_%';
Use pgloader to export data from SQLite to PostgreSQL using command and script:
pgloader selectzero.load
As license validation will fail, you can manually restart platform once after data is loaded (or insert license manually again)