Skip to content
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

Docs: Backup&Restore: fixed rendering + minor fixes #6569

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions docs/content/doc/usage/backup-and-restore.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ file can be unpacked and used to restore an instance.

## Backup Command (`dump`)

Switch to the user running gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the gitea installation
Switch to the user running Gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the Gitea installation
directory. There should be some output similar to the following:

```
```none
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
2016/12/27 22:32:22 Dumping database...
Expand All @@ -35,7 +35,7 @@ directory. There should be some output similar to the following:
Inside the `gitea-dump-1482906742.zip` file, will be the following:

* `app.ini` - Optional copy of configuration file if originally stored outside of the default `custom/` directory
* `custom` - All config or customerize files in `custom/`.
* `custom` - All config or customization files in `custom/`.
* `data` - Data directory in <GITEA_WORK_DIR>, except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, sqlite file if you are using sqlite.
* `gitea-db.sql` - SQL dump of database
* `gitea-repo.zip` - Complete copy of the repository directory.
Expand All @@ -45,15 +45,18 @@ Intermediate backup files are created in a temporary directory specified either
`--tempdir` command-line parameter or the `TMPDIR` environment variable.

### Using Docker (`dump`)

There are a few caveats for using the `dump` command with Docker.

The command has to be executed with the `RUN_USER = <OS_USERNAME>` specified in `gitea/conf/app.ini`; and, for the zipping of the backup folder to occur without permission error the command `docker exec` must be executed inside of the `--tempdir`.

Example:

```docker exec -u <OS_USERNAME> -it -w <--tempdir> $(docker ps -qf "name=<NAME_OF_DOCKER_CONTAINER>") bash -c '/app/gitea/gitea dump -c </path/to/app.ini>'```
```none
docker exec -u <OS_USERNAME> -it -w <--tempdir> $(docker ps -qf "name=<NAME_OF_DOCKER_CONTAINER>") bash -c '/app/gitea/gitea dump -c </path/to/app.ini>'
```

*Note: `--tempdir` refers to the temporary directory of the docker enviroment used by gitea; if you have not specified a custom `--tempdir`, then gitea uses `/tmp` or the `TMPDIR` enviromental variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly.
*Note: `--tempdir` refers to the temporary directory of the docker environment used by Gitea; if you have not specified a custom `--tempdir`, then Gitea uses `/tmp` or the `TMPDIR` environment variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly.

The result should be a file, stored in the `--tempdir` specified, along the lines of: `gitea-dump-1482906742.zip`

Expand All @@ -63,7 +66,8 @@ There is currently no support for a recovery command. It is a manual process tha
involves moving files to their correct locations and restoring a database dump.

Example:
```

```none
apt-get install gitea
unzip gitea-dump-1482906742.zip
cd gitea-dump-1482906742
Expand Down