Restore error for multiple configurations #1160

Closed
opened 2025-10-08 21:22:39 +00:00 by markruys · 3 comments

What I'm trying to do and why

I have a Borgmatic setup with a single repository and two configurations files 'year.yaml' and 'week.yaml'. Only the 'year.yaml' contains a database configuration definition.

Database restore does work, but gives errors related to the configuration without database configuration ('week.yaml').

Steps to reproduce

21d37bdf8f4e:/# borgmatic restore --archive year-2025-10-08-220606  --database xxxx --verbosity 1

Actual behavior

backupserver: Restoring data sources from archive year-2025-10-08-220606
backupserver: Error running actions for repository
backupserver: No data source dumps were found to restore
/etc/borgmatic.d/week.yaml: Error running configuration
/etc/borgmatic.d/week.yaml: An error occurred
backupserver: Restoring data sources from archive year-2025-10-08-220606
backupserver: Restoring data source xxxx@mariadb (mariadb_databases)

summary:
An error occurred
Error running actions for repository
No data source dumps were found to restore
Error running configuration
/etc/borgmatic.d/year.yaml: Successfully ran configuration file

Need some help? https://torsion.org/borgmatic/#issues

Expected behavior

backupserver: Restoring data sources from archive year-2025-10-08-220606
backupserver: Restoring data source xxxx@mariadb (mariadb_databases)

summary:
/etc/borgmatic.d/year.yaml: Successfully ran configuration file

Other notes / implementation ideas

No response

borgmatic version

2.0.7

borgmatic installation method

Container

Borg version

1.4.1

Python version

3.13.3

Database version (if applicable)

MariaDB 10.6.23

Operating system and version

Alpine 3.21.4

### What I'm trying to do and why I have a Borgmatic setup with a single repository and two configurations files 'year.yaml' and 'week.yaml'. Only the 'year.yaml' contains a database configuration definition. Database restore does work, but gives errors related to the configuration without database configuration ('week.yaml'). ### Steps to reproduce ``` 21d37bdf8f4e:/# borgmatic restore --archive year-2025-10-08-220606 --database xxxx --verbosity 1 ``` ### Actual behavior ``` backupserver: Restoring data sources from archive year-2025-10-08-220606 backupserver: Error running actions for repository backupserver: No data source dumps were found to restore /etc/borgmatic.d/week.yaml: Error running configuration /etc/borgmatic.d/week.yaml: An error occurred backupserver: Restoring data sources from archive year-2025-10-08-220606 backupserver: Restoring data source xxxx@mariadb (mariadb_databases) summary: An error occurred Error running actions for repository No data source dumps were found to restore Error running configuration /etc/borgmatic.d/year.yaml: Successfully ran configuration file Need some help? https://torsion.org/borgmatic/#issues ``` ### Expected behavior ``` backupserver: Restoring data sources from archive year-2025-10-08-220606 backupserver: Restoring data source xxxx@mariadb (mariadb_databases) summary: /etc/borgmatic.d/year.yaml: Successfully ran configuration file ``` ### Other notes / implementation ideas _No response_ ### borgmatic version 2.0.7 ### borgmatic installation method Container ### Borg version 1.4.1 ### Python version 3.13.3 ### Database version (if applicable) MariaDB 10.6.23 ### Operating system and version Alpine 3.21.4
Owner

Thanks for filing this. The behavior you're seeing is somewhat by design... When you run an action, you're telling borgmatic: Execute this action (independently) for each borgmatic configuration file. So in the case of restore, it tries to restore the selected --database once for each config. That's why you're getting one success and one failure (resulting in an overall failure).

So one thing you can do is specify --config year.yaml along with the rest of your command to select a particular config file. That way you're only running the restore action for that one config file.

Thanks for filing this. The behavior you're seeing is somewhat by design... When you run an action, you're telling borgmatic: Execute this action (independently) for *each* borgmatic configuration file. So in the case of restore, it tries to restore the selected `--database` once for each config. That's why you're getting one success and one failure (resulting in an overall failure). So one thing you can do is specify `--config year.yaml` along with the rest of your command to select a particular config file. That way you're only running the `restore` action for that one config file.
Author

Awesome, that did the trick!

I must say I'm really impressed by the high quality of borg and borgmatic, glad I found it. Also documentation is very clear and helpful. Talking of documentation, you might want to add a note how to handle a multi config setup in https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#database-restoration and the --config option.

Awesome, that did the trick! I must say I'm really impressed by the high quality of borg and borgmatic, glad I found it. Also documentation is very clear and helpful. Talking of documentation, you might want to add a note how to handle a multi config setup in https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#database-restoration and the `--config` option.
Owner

Glad to hear that did it! I'm currently revamping the documentation as part of #942, so I'll update the database restoration as you suggest as part of that work.

Glad to hear that did it! I'm currently revamping the documentation as part of #942, so I'll update the database restoration as you suggest as part of that work.
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1160
No description provided.