django-dbbackup
django-dbbackup copied to clipboard
Restore fail after editing DBBACKUP_FILENAME_TEMPLATE
Bug Report
Describe the bug
When I try to restore the database the command return CommandError: There's no backup file available. whereas the backup file was listed when I run listbackups.
To Reproduce
In setting file:
def backup_filename(databasename, servername, datetime, extension, content_type):
return f"{content_type}-{datetime}.{extension}"
DBBACKUP_FILENAME_TEMPLATE = backup_filename
DBBACKUP_MEDIA_FILENAME_TEMPLATE = backup_filename
Expected behavior
Restore the .dump file no matter the name.
Workaround
Prefix the database file by database name.
def backup_filename(databasename, servername, datetime, extension, content_type):
return f"{databasename}-{content_type}-{datetime}.{extension}"
Versions
Django-dbbackup
- poetry: 3.3.0
External tools
- Python: 3.9
- Django: 3.2.12
- OS: RockyLinux 8.5
Hi, I'm going to be working on this issue in the next couple of days/weeks. Thanks