3

I would like to use the dump command from the gitea docs.

See: https://docs.gitea.io/en-us/backup-and-restore/

The reason I ask is because I naively installed gitea on a raspberry pi with not much storage, and it is reaching the point where I need to upgrade the storage for the repository's sake.

I would like to perform this command remotely and save the resulting zip file remotely because, naturally, the gitea database is so full that I don't think it would be able to dump locally before all remaining storage space is used.

How can I perform this command remotely and save the resulting .zip file remotely?

./gitea dump -c /path/to/app.ini

EDIT: It just occurred to me that I could dump to a flash drive too. I am open to any option but I need a hand with figuring out how to modify the above command to dump in the right spot.

Justapigeon
  • 560
  • 1
  • 8
  • 22
  • I found the `dump` command in the source files. See: https://github.com/go-gitea/gitea/blob/master/cmd/dump.go – Justapigeon Aug 19 '19 at 22:01
  • I am not familiar with `go` but I think adding the `-t` flag and specifying an additional directory will dump to a different path. I will test this later today and report what worked. – Justapigeon Aug 19 '19 at 22:02
  • I have provided an answer for how to accomplish this with a USB drive but I will accept a future answer that provides a remote solution (e.g., via local network and ssh). – Justapigeon Aug 20 '19 at 13:07

1 Answers1

3

I found the solution by using a local USB and digging into the source code.

# login as your database user, for me it is root
su -

# navigate to your gitea folder
cd /home/USER/gitea

# run the dump command
./gitea-1.9-whatever-this-is-my-relevant-app-file dump -t /media/USER/drive/

Note that, at least in Gitea 1.9, there is no need to use -c /path/to/app.ini as it is set to the correct directory by default. The -t flag will point the dump to the directory you want. In my case, a USB drive.

Justapigeon
  • 560
  • 1
  • 8
  • 22
  • If you have a lot of files like me, might be helpful to throw-in `-V` so you can watch the dump – Justapigeon Aug 20 '19 at 05:31
  • For verbose to work, place it before the `-t` flag and ensure that it is capitalized. For example: `./gitea-1.9-whatever-this-is-my-relevant-app-file dump -V -t /media/USER/drive/` – Justapigeon Oct 14 '19 at 03:58