Backing up your OpenProject installation
We advise to backup your OpenProject installation regularly — especially before upgrading to a newer version.
What should be backed up
In general the following parts of your OpenProject installation should be backed up:
- Data stored in the database
- Configuration files
- Uploaded files (attachments)
- Repositories (subversion, git) if applicable
Package-based installation (DEB/RPM)
The DEB/RPM packages provide a backup tool which can be used to take a snapshot of the current OpenProject installation. This tool will create a backup of all parts mentioned above. The backup tool is invoked by executing the following command:
sudo openproject run backup
The command will create backup files in the following location on your system:
/var/db/openproject/backup
The content of that directory should look very similar to the following.
root@ip-10-0-0-228:/home/admin# ls -al /var/db/openproject/backup/
total 1680
drwxr-xr-x 2 openproject openproject 4096 Nov 19 21:00 .
drwxr-xr-x 6 openproject openproject 4096 Nov 19 21:00 ..
-rw-r----- 1 openproject openproject 1361994 Nov 19 21:00 attachments-20191119210038.tar.gz
-rw-r----- 1 openproject openproject 1060 Nov 19 21:00 conf-20191119210038.tar.gz
-rw-r----- 1 openproject openproject 126 Nov 19 21:00 git-repositories-20191119210038.tar.gz
-rw-r----- 1 openproject openproject 332170 Nov 19 21:00 postgresql-dump-20191119210038.pgdump
-rw-r----- 1 openproject openproject 112 Nov 19 21:00 svn-repositories-20191119210038.tar.gz
You should then copy those dump files to a secure location, for instance an S3 bucket or some sort of backup server.
Docker-based installation
If you are using docker-compose, then the data volumes are managed by Docker and you should have a look at the official Docker documentation for instructions on how to backup.
If you are using the all-in-one container, then you can simply backup any local volumes that you chose to bind-mount with the -v
option when launching the container. For instance if you launched the container with:
sudo mkdir -p /var/lib/openproject/{pgdata,assets}
docker run -d -p 8080:80 --name openproject -e SECRET_KEY_BASE=secret \
-v /var/lib/openproject/pgdata:/var/openproject/pgdata \
-v /var/lib/openproject/assets:/var/openproject/assets \
openproject/community:10
Then you would need to backup the /var/lib/openproject
folder (for instance to S3 or FTP server).
Dumping the database
When using docker-compose you can simply dump the database from the database container.
docker exec -it db_1 pg_dump -U postgres -d openproject -x -O > openproject.sql
This assumes that the database container is called db_1
. Find out the actual name on your host using docker ps | postgres
.
All-in-one container
If you need a regular dump of the database you can get one using pg_dump
like this:
docker exec -e PGPASSWORD=openproject -it $OP_CONTAINER_NAME pg_dump -U openproject -h localhost -d openproject -x -O > openproject.sql
Where $OP_CONTAINER_NAME
is the name of your OpenProject container. If you don’t know it you can find it using docker ps | grep openproject
.
Importing the dump into a new container
Follow the instructions in the restoring section to import a dump into a new container.
Help and feedback
If you did not find what you were looking for
If you need help from the community or want to support others
If you are eligible for professional support and have more questions
REQUEST SUPPORT
If you find an easily fixable error or need for improvement in the documentation for the stable release
If you would like to suggest bigger updates or improvements to this documentation
If you want to contribute to translate this documentation to another language
If there's something you don't like or understand about this feature
If you want to propose a new feature that OpenProject does not offer yet
To further help OpenProject to shape and test new features
To view OpenProject premium features and pricing
If you want to try all premium features in the OpenProject Cloud Edition 14 days for free
If you want to try all premium features in your on premise Community installation 14 days for free