Use one of two database configurations to deploy Creatio:
-
Use a remote DBMS (recommended)
-
Use a local PostgreSQL server.
If you already have a PostgreSQL server set up, skip to step II.
If you have already set up sysadmin (with privileges to log in, create and modify databases) and public (unprivileged) user roles, skip to step III.
I. Install PostgreSQL
PostgreSQL setup files are available for download at postgresql.org.
II. Create PostgreSQL user
A fresh installation of PostgreSQL Server is not ready for deploying Creatio immediately. If you plan to use a fresh installation of PostgreSQL Server, you need to create a user that can log in to the database using a password and has sufficient privileges to create and update a database. By default, no such user will be available.
We recommend to create two database users in PostgreSQL:
-
A user with the “sysadmin” role who has maximum access privileges on the database server level. This user will restore the Creatio database from a backup file and assign access permissions. These instructions use pg_sysadmin as a placeholder username, but you can set the username to any value.
-
A user with the “public” role whose permissions are limited. You will need this user to set up a secure connection to the restored Creatio database using PostgreSQL authentication. These instructions use pg_user as a placeholder username, but you can set the username to any value.
To create the two PostgreSQL users:
-
Open the Command Prompt.
-
Navigate to the PostgreSQL software install folder:
-
\\path\to\PostgreSQL\folder – the path to the PostgreSQL software install folder.
-
-
Navigate to the folder with the Command Line Tools component:
-
Enter the DB connection password in the environment variable.
-
pg_password – password of the postgres user for connecting to the PostgreSQL server.
-
-
Run PostgreSQL shell as postgres:
-
Create a sysadmin user, e. g. pg_sysadmin:
-
pg_sysadmin – placeholder name for a sysadmin user. The sysadmin will restore the Creatio database from a backup file and assign access permissions.
-
-
Make pg_sysadmin a system administrator:
-
Allow pg_sysadmin to log in:
-
Set a password for pg_sysadmin:
-
pg_syspassword – sysadmin user password for connecting to the PostgreSQL server.
-
-
Create a public user, e. g. pg_user:
-
pg_user – placeholder name for a public user. This user will set up a connection to the restored Creatio database.
-
-
Allow pg_user to log in:
-
Set a password for pg_user:
-
pg_password – public user password for connecting to the PostgreSQL server.
-
-
Exit the PostgreSQL shell:
III. Restore PostgreSQL database
To restore a PostgreSQL database from a backup file, you will need psql.exe and pg_restore.exe utilities. Both are part of the Command Line Tools PostgreSQL component that comes with the PostgreSQL Server. They are located in the PostgreSQL software install folder.
If you plan to use a remote PostgreSQL database without installing the PostgreSQL Server on your machine, take the following steps:
-
Get a PostgreSQL binary package. Binary packages are available for download at postgresql.org.
-
Select the Command Line Tools component during installation. Selecting the other components is optional.
To restore the Creatio database from a backup file:
-
Open Command Prompt.
-
Navigate to the PostgreSQL software install folder:
-
\\path\to\PostgreSQL\folder – the path to the PostgreSQL software install folder.
-
-
Navigate to the folder with executables:
-
Enter the DB connection password in the environment variable:
-
pg_syspassword – sysadmin user password for connecting to the PostgreSQL server.
-
-
Create a database where the backup data will be restored.
For Creatio version 7.16.3 or higher:
-
pg_server_ip – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either superuser (administrator) privileges or “CREATE DATABASE” privileges.
-
pg_user – the application will use this user's credentials to connect to the database. You can specify any user when creating the database. To change the user data, follow step 10 of this instruction.
For Creatio version 7.16.0 – 7.16.2:
-
pg_server_address – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either superuser (administrator) privileges or “CREATE DATABASE” privileges.
-
pg_user – the “public” user who will be granted permission to use and update the Creatio database
-
-
If you are using AWS RDS:
-
Download the ChangeTypesOwner.sql script.
-
In the script, replace the “postgres” value with a valid Postgres username.
-
Run the updated ChangeTypesOwner.sql script.
-
-
Restore the Creatio database from the backup file:
For Creatio version 7.16.3 or higher:
-
pg_server_ip – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either superuser (administrator) privileges or sufficient access permissions to run the pg_restore utility.
-
pg_dbname_creatio – name of the PostgreSQL DB to insert backup tables.
For Creatio version 7.16.0 – 7.16.2:
-
pg_server_address – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either superuser (administrator) privileges or sufficient access permissions to run the pg_restore utility.
-
pg_dbname_creatio – name of the PostgreSQL DB to insert backup tables.
-
-
Download the CreateTypeCastsPostgreSql.sql file.
-
Execute type conversion:
-
pg_server_ip – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user with administrator privileges for connecting to the PostgreSQL server.
-
pg_dbname_creatio – name of the PostgreSQL DB where the instructions will be executed.
-
\\path\to\CreateTypeCastsPostgreSql.sql – path to the downloaded CreateTypeCastsPostgreSql.sql file.
-
-
Creatio version 7.16.3 supports changing the owner of the database and database objects to a non-administrator user (i. e. not a superuser). To do this, use the ChangeDbObjectsOwner script. Download the script.
To restore the database from a backup as a regular user:
-
Change the owner of the database:
-
pg_server_ip – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either administrator (superuser) privileges or “CREATE DATABASE” privileges.
-
pg_user – new database owner.
-
pg_dbname_creatio – the name of the database whose owner is changed.
-
-
Change the owner of the database objects:
-
pg_server_ip – PostgreSQL server address.
-
pg_server_port – PostgreSQL server port.
-
pg_sysadmin – user for connecting to the PostgreSQL server. The user must have either administrator (superuser) privileges or “CREATE DATABASE” privileges.
-
pg_user – new database owner.
-
pg_dbname_creatio – the name of the database whose owner is changed.
-
\\path\to\ChangeDbObjectsOwner.sql – path to the downloaded ChangeDbObjectsOwner.sql file.
-
Skip this step to leave the default owner of the database and database objects, which is the user who runs the pg_restore utility (usually postgres)
-