-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Gitea dump duplicates repositories on windows #21662
Comments
So which one is not in the right place? |
Maybe it's related to a long-standing bug, you shouldn't run |
Apologies for the delay... Interesting bug. I have just tried this and the result is the same
Very good question :) I suspect it is linux but it is likely due to a subtle difference in on-disk file structure. Looking at the restore part of the docs: https://docs.gitea.io/en-us/backup-and-restore/#restore-command-restore
the repositories are meant to be in the root of the gitea working directory as this is where the restore sequence is instructing the user to act. Looking at the dump generated from gitea running in an Alpine VE I see the structure aligns with this
Looking at the dump generated from a gitea running in a windows MS I see a subtle difference
I noticed this oddity some months ago where the backup zip was larger than the on-disk structure but I didn't look into it. I recently pushed some older git repos to the instance running on windows and the recent backups are growing on-disk = 708Meg the sql dump (the only thing that should be different) is 1Meg in size. I spent a bit of time looking over the dump code but I havn't managed to get my head around how it works to try to understand what it is trying to dump, let alone why it is making this additional directory and only for windows |
I do have this in my app.ini
Now thinking about this... could this be related. Looking at: So I set this "just in case" based upon the "windows as a service" to include full path: So a running gitea is correctly reading this location. Now the backup... the backup code does two things
since I have repositories in the data subdirectory it is getting archived twice. So in theory I should be able to comment out the [repository] section, move the D:/gitea/data/gitea-repositories to D:/gitea/gitea-repositories and gitea should keep working but also the gitea dump will be ~ the on-disk size |
So should you move repositories out of data or should Gitea check if repositories directory under |
good question :) should gitea check if the repositories are under ./data ... looking at the issue @wxiaoguang linked there is some commonality as the migration also put the repositories under ./data. Its extra logic to check and skip |
ok its a bit more involved than that... I commented out the [repository] entry and ran git dump to test:
that aside, the archive is back to an expected size |
re-opening as we've received a similar report via chat |
Hi, Any more information on this? I'm having the same problem (1.20.2) |
When writing #30240 , I think I understand more about the problems now (the "dump" code wasn't written by me, so it really takes a lot of time to understand what it is doing ....) The root problem is that some directories overlapped. For example: Gitea expects to backup PathA and PathB. But if At the moment I don't have a clear plan for a complete rewriting. And I can see that the "dump" command has a lot of problems. So a workaround could be "manually copy the data directory and dump the database", it is more flexible and controllable. |
Description
When comparing the resultant archive produced via "gitea dump" between windows and linux, the windows archive is twice as large.
It appears the bare repositories are duplicated in two locations
Gitea Version
1.17.2
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.34
Operating System
windows, linux
How are you running Gitea?
service
Database
MySQL
The text was updated successfully, but these errors were encountered: