Skip to content

Commit 49874b7

Browse files
johanvdwlunnyzeripath
authored
dump: Add option to skip index dirs (#21501)
closes #20683 Add an option to gitea dump to skip the bleve indexes, which can become quite large (in my case the same size as the repo's) and can be regenerated after restore. Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent c04ad76 commit 49874b7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/dump.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
146146
Name: "skip-package-data",
147147
Usage: "Skip package data",
148148
},
149+
cli.BoolFlag{
150+
Name: "skip-index",
151+
Usage: "Skip bleve index data",
152+
},
149153
cli.GenericFlag{
150154
Name: "type",
151155
Value: outputTypeEnum,
@@ -327,6 +331,11 @@ func runDump(ctx *cli.Context) error {
327331
excludes = append(excludes, opts.ProviderConfig)
328332
}
329333

334+
if ctx.IsSet("skip-index") && ctx.Bool("skip-index") {
335+
excludes = append(excludes, setting.Indexer.RepoPath)
336+
excludes = append(excludes, setting.Indexer.IssuePath)
337+
}
338+
330339
excludes = append(excludes, setting.RepoRootPath)
331340
excludes = append(excludes, setting.LFS.Path)
332341
excludes = append(excludes, setting.Attachment.Path)

0 commit comments

Comments
 (0)