i can‘t restore the backup-sql by Backup and restore Taiga
Welcome to the community!
You’re getting this error because your database is not empty and you’re trying to duplicate unique data when trying to load the dump.
I assume you have created a dump following the guide using this command:
$ docker exec taiga-docker-taiga-db-1 pg_dump -U taiga taiga > taiga-db-backup.sql
So, you already have a backup file in your directory called
Then, you just have to move it to the database container, delete the existing database with your
POSTGRES_PASSWORD (values from your .env file), and restore it again with the previous dump. I left you these steps:
- move the dump to the database container:
$ docker cp taiga-db-backup.sql taiga-docker-taiga-db-1:/taiga-db-backup.sql
- connect to taiga-db, delete the existing ‘taiga’ database and re-create a new empty one using the same name:
$ docker exec -ti taiga-docker-taiga-db-1 /bin/bash
root@fc44e32c1db4:/# psql -U taiga taiga
taiga=# \c postgres
postgres=# drop database taiga;
postgres=# create database taiga;
- then press
Ctrl + Dto exit the postgres console, and finally load the dump in the new database:
root@fc44e32c1db4:/# psql -U taiga taiga < taiga-db-backup.sql
Tell us how it goes!
Thank you very much, this is helpful!