Home Backing up an openMAINT Database with pg_dump

Backing up an openMAINT Database with pg_dump

Photo credit - panumas nikhomkhai


The information in your openMAINT instance is stored in a PostgreSQL database. It can be simply backed up in the form of a .dump file with a single command.

Follow this guide for an explanation of how pg_dump works in the context of openMAINT’s database.

Note: At the time of writing, the most recent version of openMAINT is openMAINT 3.4 and it is still recommended to use PostgreSQL version 10, so this guide will assume your database is also configured for use with PostgreSQL 10.

Backing up the database

We will use pg_dump to create a .dump file of our PostgreSQL database. Modify the following command to fit your database and name the output file, and use it to create your database backup:

 pg_dump -Fc -h --cluster 10/main -U postgres <your_database_name> -f openMAINT_backup_MM_DD_YYYY.dump
  • The -Fc flag specifies that the database has a custom format.
  • The -h flag specifies the host in the case of a standard openMAINT installation
  • The --cluster flag specifies version 10/main. This is necessary to avoid version mismatching when restoring to an instance of openMAINT running on top of PostgreSQL 10.
  • The -U flag is our user, postgres, in the case of a standard openMAINT installation
  • The -f flag specifies our filename.dump

That’s it! You will find your output .dump file in whatever directory you ran the command in.


I am not affiliated with Tecnoteca Srl., nor am I maintainer of either openMAINT, or CMDBuild. This guide is written in good faith, and in the spirit of contribution towards the Free Software Movement, for consumption as-is.

Some of the steps listed in this guide may break or cease to function as software packages are updated, deprecated, or become obseleted.


openMAINT on SourceForge


pg_dump on postgresql.org

This post is licensed under CC BY 4.0 by the author.