restore specific db issue using pgbackrest

1.1k views Asked by At

I have a question about how to backup a specific Database using pgbackrest: the problem is when I tried to restore a selected db using --include-db option of pgbackrest i got just the selected db and built-in databases(postgres, template0 and template1) restored, and when i tried to connect another db after the restore I got this error :

**FATAL: relation mapping file "base/24581/pg_filenode.map" contains invalid data
Previous connection kept**

is there any solution that allows the restore of the whole db with the selected one without losing the other databases ??

Thank you

1

There are 1 answers

0
pifor On

I don't think this is possible according to the documentation of Include Database option:

Include Database Option (--db-include) Restore only specified databases. This feature allows only selected databases to be restored. Databases not specifically included will be restored as sparse, zeroed files to save space but still allow PostgreSQL to perform recovery. After recovery the databases that were not included will not be accessible but can be removed with the drop database command. NOTE: built-in databases (template0, template1, and postgres) are always restored.