You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today (2025-07-01 12:00 +8)
download from github release and unzip
i want try backup and restore function
but get error
To reproduce
run server
".\gogs web" then setting first time(in my case is use sqlite)
and create account then create repo then push some file on server
stop server,use this command backup
".\gogs backup" -> out put "gogs-backup-.zip"
and restore immediately(zip file name is some time string)
".\gogs restore --config .\custom\conf\app.ini" --verbose --from .\gog-backup-.zip"
will fail and get this message
I can reproduce this on Windows 11 with a build from main and SQLite. The first gogs restore leaves custom.bak behind, so the next restore fails on that rename, and it only fails after the database has already been imported: a user I added between the two restores was gone afterwards.
I have a small fix that checks for leftover .bak paths (custom and the data directories being restored) before importing anything, and stops with a message naming the path. If you'd rather it remove the old .bak itself, I can do that instead. Happy to open a PR either way.
Activity
b84330808 commentedon Nov 7, 2026
I can reproduce this on Windows 11 with a build from
mainand SQLite. The firstgogs restoreleavescustom.bakbehind, so the next restore fails on that rename, and it only fails after the database has already been imported: a user I added between the two restores was gone afterwards.I have a small fix that checks for leftover
.bakpaths (customand the data directories being restored) before importing anything, and stops with a message naming the path. If you'd rather it remove the old.bakitself, I can do that instead. Happy to open a PR either way.unknwon commentedon Nov 12, 2026
Since #8453,
gogs restorechecks for leftover.bakpaths first and tells you which one to move, before touching the database.