1. Recommended backup process for Taiga6 docker

This is the recommended backup process, as using Taiga6 with docker is the recommended way to run Taiga in production. This tutorial assumes that you have a Taiga6 docker instance running.

This tutorial has been tested with the official Taiga6 docker image.

First, create a directory on the host where you want to store your backups in and switch into it. For this example we’re going to use

:/# mkdir taiga-backup
:/# cd taiga-backup

Export the database contents from the database container into your backup directory on your host machine via sql dump.

:/# docker exec taiga-docker_taiga-db_1 pg_dump -U taiga taiga > taiga-db-backup.sql

Then tar the media files inside the taiga-back container.

:/# docker exec taiga-docker_taiga-back_1 tar czf taiga-media-backup.tar.gz media

Copy them out of the container into the taiga-backup directory on your host.

:/# docker cp taiga-docker_taiga-back_1:/taiga-back/taiga-media-backup.tar.gz .

Anyone should only need to backup the database and the media files but exclude the static files, because they are recollected anytime with Django collectstatic.

Finally, delete the media backup archive inside the taiga-back container.

:/# docker exec taiga-docker_taiga-back_1 rm taiga-media-backup.tar.gz

2. Recommended restore process for Taiga6 docker

This tutorial assumes that you have fresh server running and you want to restore your backed up Taiga6 data. You installed all the preriquisities, cloned the Taiga6 docker repository and moved into it.

Follow these steps:

# Run only the database to avoid migrations
$ docker-compose up -d taiga-db

# Copy the dump inside the container:
$ docker cp taiga-db-backup.sql taiga-docker_taiga-db_1:/taiga-db-backup.sql

# Access the container
$ docker exec -ti taiga-docker_taiga-db_1 /bin/bash

And inside the container, load the dump:

:/# psql -U taiga taiga < taiga-db-backup.sql

Check that the data have been properly migrated. Delete the taiga-db-backup.sql file and exit the container.

2.1. Migrate the database

Next step is to run Taiga6 backend so the database can be migrated to the new schema:

$ docker-compose up -d taiga-back

2.2. Migrate the media files

With the backend up and running, copy the taiga-media-backup.tar.gz file inside the backend container and access the container:

$ docker cp taiga-media-backup.tar.gz taiga-docker_taiga-back_1:/taiga-media-backup.tar.gz
$ docker exec -ti taiga-docker_taiga-back_1 /bin/bash

And inside the container, remove the old media and extract the files:

:/# mv /taiga-media-backup.tar.gz /taiga-back/media
:/# cd /taiga-back/media
:/# tar -xzvf taiga-media-backup.tar.gz --strip 1
:/# rm taiga-media-backup.tar.gz
:/# chown -R taiga:taiga *

Exit the container after you’re finished.

2.3. Run Taiga6

Once everything has been migrated, launch all the services and check the result:

$ docker-compose up -d

Go to http://localhost:9000 where everything should be migrated and available.