Skip to content

Commit df9802c

Browse files
OCram85Marco BlessingGustedtechknowlogick
authored
adds restore docs for docker based instances (#18844)
* adds docke restore section * fix typo * Update docs/content/doc/usage/backup-and-restore.en-us.md Co-authored-by: Gusted <[email protected]> * fix container id placeholder * adds restore help for docker-rootless * restore yml autoformater quotes Co-authored-by: Marco Blessing <[email protected]> Co-authored-by: Gusted <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent dd712b7 commit df9802c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

docs/content/doc/usage/backup-and-restore.en-us.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,59 @@ Repository Git Hooks should be regenerated if installation method is changed (eg
9595
With Gitea running, and from the directory Gitea's binary is located, execute: `./gitea admin regenerate hooks`
9696

9797
This ensures that application and configuration file paths in repository Git Hooks are consistent and applicable to the current installation. If these paths are not updated, repository `push` actions will fail.
98+
99+
### Using Docker (`restore`)
100+
101+
There is also no support for a recovery command in a Docker-based gitea instance. The restore process contains the same steps as described in the previous section but with different paths.
102+
103+
Example:
104+
105+
```sh
106+
# open bash session in container
107+
docker exec --user git -it 2a83b293548e bash
108+
# unzip your backup file within the container
109+
unzip gitea-dump-1610949662.zip
110+
cd gitea-dump-1610949662
111+
# restore the gitea data
112+
mv data/* /data/gitea
113+
# restore the repositories itself
114+
mv repos/* /data/git/repositories/
115+
# adjust file permissions
116+
chown -R git:git /data
117+
# Regenerate Git Hooks
118+
/usr/local/bin/gitea -c '/data/gitea/conf/app.ini' admin regenerate hooks
119+
```
120+
121+
The default user in the gitea container is `git` (1000:1000). Please replace `2a83b293548e` with your gitea container id or name.
122+
123+
These are the default paths used in the container:
124+
125+
```text
126+
DEFAULT CONFIGURATION:
127+
CustomPath: /data/gitea (GITEA_CUSTOM)
128+
CustomConf: /data/gitea/conf/app.ini
129+
AppPath: /usr/local/bin/gitea
130+
AppWorkPath: /usr/local/bin
131+
```
132+
133+
### Using Docker-rootless (`restore`)
134+
135+
The restore workflow in Docker-rootless containers differs only in the directories to be used:
136+
137+
```sh
138+
# open bash session in container
139+
docker exec --user git -it 2a83b293548e bash
140+
# unzip your backup file within the container
141+
unzip gitea-dump-1610949662.zip
142+
cd gitea-dump-1610949662
143+
# restore the app.ini
144+
mv data/conf/app.ini /etc/gitea/app.ini
145+
# restore the gitea data
146+
mv data/* /var/lib/gitea
147+
# restore the repositories itself
148+
mv repos/* /var/lib/gitea/git/repositories
149+
# adjust file permissions
150+
chown -R git:git /etc/gitea/app.ini /var/lib/gitea
151+
# Regenerate Git Hooks
152+
/usr/local/bin/gitea -c '/etc/gitea/app.ini' admin regenerate hooks
153+
```

0 commit comments

Comments
 (0)