Skip to content

dump-repo command is somewhat dangerous: removing the data directory if failed. #20191

Closed
@wxiaoguang

Description

@wxiaoguang

DumpRepository -> migrateRepository -> uploader.Rollback -> os.RemoveAll(g.baseDir)

If migrateRepository returns error, then the data directory is removed completely.

I have run gitea dump-repo in the gitea directory, then the Gitea's data directory (including sqlite database, repositories) is removed, all lost (luckily not on production).

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions