Skip to content

[Question] Does gitea dump protect against data corruption when backing up live repos? #19640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
annanyearian opened this issue May 6, 2022 · 1 comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@annanyearian
Copy link

Feature Description

I have been reading about how to backup git repositories and there is some concern from 9 years ago that copying a repository mid-operation would lead to inconsistent data - difficulties in backing up live git repositories. I can't find any information about if this was changed, but I imagine not.

Does the gitea dump command protect against this type of issue when it copies repositories, or do I need to make sure users are not doing anything? (~shutting down gitea service while backing up)

Screenshots

No response

@annanyearian annanyearian added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels May 6, 2022
@wxiaoguang
Copy link
Contributor

The answer is in code https://github.com/go-gitea/gitea/blob/main/cmd/dump.go

gitea dump just writes all the files under repos directory into the archiver, one by one. Shutting down gitea is the most safe way to do dump.

Personally I always use low-level methods to do backup & restore (eg: zfs snapshot), no stop time anymore.

@wxiaoguang wxiaoguang added type/question Issue needs no code to be fixed, only a description on how to fix it yourself. issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels May 7, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

3 participants