[Forgejo] Add backup support for Code Flow #7

Closed
opened 2023-11-25 21:19:35 +00:00 by dananglin · 2 comments
Owner

Add support for taking on demand backups of Code Flow.

Add support for taking on demand backups of Code Flow.
dananglin self-assigned this 2023-11-25 21:20:35 +00:00
Author
Owner

The dump command's help documentation for reference:

$ forgejo dump --help
NAME:
   Forgejo dump - Dump compresses all related files and database into zip file.
It can be used for backup and capture Forgejo server image to send to maintainer

USAGE:
   Forgejo dump command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --file value, -f value         Name of the dump file which will be created. Supply '-' for stdout. See type for available types. (default: "forgejo-dump-1700989488.zip")
   --verbose, -V                  Show process details
   --quiet, -q                    Only display warnings and errors
   --tempdir value, -t value      Temporary dir path (default: "/tmp")
   --database value, -d value     Specify the database SQL syntax
   --skip-repository, -R          Skip the repository dumping
   --skip-log, -L                 Skip the log dumping
   --skip-custom-dir              Skip custom directory
   --skip-lfs-data                Skip LFS data
   --skip-attachment-data         Skip attachment data
   --skip-package-data            Skip package data
   --skip-index                   Skip bleve index data
   --type value                   Dump output format: zip, tar, tar.sz, tar.gz, tar.xz, tar.bz2, tar.br, tar.lz4, tar.zst (default: zip)
   --help, -h                     show help
   --custom-path value, -C value  Set custom path (defaults to '{WorkPath}/custom')
   --config value, -c value       Set custom config file (defaults to '{WorkPath}/custom/conf/app.ini')
   --work-path value, -w value    Set Gitea's working path (defaults to the Gitea's binary directory)
The dump command's help documentation for reference: ``` $ forgejo dump --help NAME: Forgejo dump - Dump compresses all related files and database into zip file. It can be used for backup and capture Forgejo server image to send to maintainer USAGE: Forgejo dump command [command options] [arguments...] COMMANDS: help, h Shows a list of commands or help for one command OPTIONS: --file value, -f value Name of the dump file which will be created. Supply '-' for stdout. See type for available types. (default: "forgejo-dump-1700989488.zip") --verbose, -V Show process details --quiet, -q Only display warnings and errors --tempdir value, -t value Temporary dir path (default: "/tmp") --database value, -d value Specify the database SQL syntax --skip-repository, -R Skip the repository dumping --skip-log, -L Skip the log dumping --skip-custom-dir Skip custom directory --skip-lfs-data Skip LFS data --skip-attachment-data Skip attachment data --skip-package-data Skip package data --skip-index Skip bleve index data --type value Dump output format: zip, tar, tar.sz, tar.gz, tar.xz, tar.bz2, tar.br, tar.lz4, tar.zst (default: zip) --help, -h show help --custom-path value, -C value Set custom path (defaults to '{WorkPath}/custom') --config value, -c value Set custom config file (defaults to '{WorkPath}/custom/conf/app.ini') --work-path value, -w value Set Gitea's working path (defaults to the Gitea's binary directory) ```
dananglin changed title from [Forgejo] Add backup support to [Forgejo] Add backup support for Code Flow 2023-11-26 10:37:12 +00:00
Author
Owner

High level implementation plan

  • stop the running Forgejo container.
  • Regenerate the docker compose file ensuring that the command to run the forgejo dump is present.
  • Run the backup and wait until finished.
  • Regenerate the docker compose file to run the Forgejo container as normal.
  • Run the forgejo container.

Further considerations

  • Ensure the backup process does not restart when finished.
  • Mount a volume for the backups for persistence. For now this will be a directory on the host.
### High level implementation plan - stop the running Forgejo container. - Regenerate the docker compose file ensuring that the command to run the `forgejo dump` is present. - Run the backup and wait until finished. - Regenerate the docker compose file to run the Forgejo container as normal. - Run the forgejo container. ### Further considerations - Ensure the backup process does not restart when finished. - Mount a volume for the backups for persistence. For now this will be a directory on the host.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: flow/services#7
No description provided.