Postgres - Postgres - Alfresco - Alfresco Sync Service - Alfresco/Alfresco-Sync-Service/5.2/Alfresco-Sync-Service/Install/Database/Postgres - 5.2 - 5.2

Alfresco Sync Service

Platform
Alfresco
Product
Alfresco Sync Service
Release
5.2
License
ft:lastPublication
2026-10-21T23:06:45.849000
ft:locale
en-US

Alfresco recommends that you use a separate PostgreSQL instance for the Sync Service.

Note: Only the Sync Service communicates with the database. It persists events taken from the JMS queue into the database. The repository doesn’t communicate with the database.

The Sync Service isn’t packaged with a PostgreSQL driver, so it’ll need to be downloaded separately and cited in the start-up. For more information on downloading the Sync Service, see Install options.

  1. Download the appropriate driver that’s compatible with JDBC42 from the download page of the PostgreSQL JDBS Driver website available at https://jdbc.postgresql.org.
    For the supported database connector version, see the compatible version for your installed version of Alfresco Content Services in the Alfresco Supported Platforms documentation.
  2. Copy the JAR file into the same directory as the Sync Service JAR.
  3. Increase the maximum connections setting in the PostgreSQL configuration file.
    1. Locate the configuration file, for example:
      • Linux: /var/lib/pgsql/x.x/data/postgresql.conf
      • Windows: C:\Program Files\PostgreSQL\x.x\data\postgresql.conf
      where x.x relates to the installed version of PostgreSQL.
    2. Add or edit the max_connections property:
      max_connections = 450
      

      If max_connections is left unchanged, bear in mind that in the PostgreSQL database, the default max_connections is 100. So, the value of the db.pool.max property in the config.yml file must be less than or equal to 100.

      If there are multiple Sync Service instances forming a cluster hidden behind a load balancer, max_connections should be greater than or equal to the sum of all db.pool.max from all config.yml files.

      For example, if max_connections=450, and there are 3 Sync Service instances, then the correct setting in config.yml is db.pool.max : 150.

    3. Restart the database.
  4. Review your memory requirements in work_mem in the postgresql.conf file in your PostgreSQL directory.

    Increasing the work_mem value increases performance and allows PostgreSQL to perform larger in-memory sorting. For more information about PostgreSQL performance, see the Tuning Your PostgreSQL Server article available at https://wiki.postgresql.org.

  5. Create a Postgres user with the username given by the sync property, sql.db.username, with password given by the sync property sql.db.password:
    CREATE USER alfresco WITH PASSWORD 'admin';
    
  6. Create a Postgres database with the name given in the property, sql.db.url, owned by the user alfresco that you will use to run PostgreSQL, and ensure that this user has write permissions on all tables and sequences.
    CREATE DATABASE alfresco OWNER alfresco ENCODING 'utf8';
    GRANT ALL PRIVILEGES ON DATABASE alfresco TO alfresco;
    
  7. Ensure sql.db.driver and sql.db.url are correctly updated in the config.yml file, e.g.
    sql:
        db:
            driver: org.postgresql.Driver
            url: jdbc:postgresql://localhost:5432/alfresco