Skip to content

Can't Restore from backup #7999

Closed
Closed

Description

@r376533

Gogs version

0.13.3

Git version

  • Server:
  • Client:
    is not about git bug

Operating system

windows11

Database

SQLite3

Describe the bug

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

Image

Expected behavior

it will success and no get any error

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. b84330808 commented on Nov 7, 2026

    @b84330808
    Contributor

    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.

  2. unknwon commented on Nov 12, 2026

    @unknwon
    Member

    Since #8453, gogs restore checks for leftover .bak paths first and tells you which one to move, before touching the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    💊 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions