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

Closed
opened 2025-11-02 08:30:59 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wxiaoguang on GitHub (Jul 1, 2022).

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).

Originally created by @wxiaoguang on GitHub (Jul 1, 2022). 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).
GiteaMirror added the issue/criticaltype/bug labels 2025-11-02 08:30:59 -06:00
Author
Owner

@a1012112796 commented on GitHub (Jul 2, 2022):

looks it's beter make sure the repo_dir is empty or not exist before dump-repo

@a1012112796 commented on GitHub (Jul 2, 2022): looks it's beter make sure the `repo_dir` is empty or not exist before `dump-repo`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9157