mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 08:08:25 +01:00
Update back-up restore example for 1.13 changes (#14374)
Signed-off-by: Daniël Vos <danielvos@outlook.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
b4dc080c96
commit
185c5ae2c4
3 changed files with 49 additions and 17 deletions
|
@ -72,15 +72,21 @@ involves moving files to their correct locations and restoring a database dump.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
apt-get install gitea
|
unzip gitea-dump-1610949662.zip
|
||||||
unzip gitea-dump-1482906742.zip
|
cd gitea-dump-1610949662
|
||||||
cd gitea-dump-1482906742
|
mv data/conf/app.ini /etc/gitea/conf/app.ini
|
||||||
mv custom/conf/app.ini /etc/gitea/conf/app.ini # or mv app.ini /etc/gitea/conf/app.ini
|
mv data/* /var/lib/gitea/data/
|
||||||
unzip gitea-repo.zip
|
mv log/* /var/lib/gitea/log/
|
||||||
mv gitea-repo/* /var/lib/gitea/repositories/
|
mv repos/* /var/lib/gitea/repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||||
|
|
||||||
|
# mysql
|
||||||
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||||
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
# sqlite3
|
||||||
|
sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||||
|
# postgres
|
||||||
|
psql -U $USER -d $DATABASE < gitea-db.sql
|
||||||
|
|
||||||
service gitea restart
|
service gitea restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -46,15 +46,21 @@ Gitea 已经实现了 `dump` 命令可以用来备份所有需要的文件到一
|
||||||
|
|
||||||
例如:
|
例如:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
apt-get install gitea
|
unzip gitea-dump-1610949662.zip
|
||||||
unzip gitea-dump-1482906742.zip
|
cd gitea-dump-1610949662
|
||||||
cd gitea-dump-1482906742
|
mv data/conf/app.ini /etc/gitea/conf/app.ini
|
||||||
mv custom/conf/app.ini /etc/gitea/conf/app.ini
|
mv data/* /var/lib/gitea/data/
|
||||||
unzip gitea-repo.zip
|
mv log/* /var/lib/gitea/log/
|
||||||
mv gitea-repo/* /var/lib/gitea/repositories/
|
mv repos/* /var/lib/gitea/repositories/
|
||||||
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||||
|
|
||||||
|
# mysql
|
||||||
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||||
# or sqlite3 $DATABASE_PATH <gitea-db.sql
|
# sqlite3
|
||||||
|
sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||||
|
# postgres
|
||||||
|
psql -U $USER -d $DATABASE < gitea-db.sql
|
||||||
|
|
||||||
service gitea restart
|
service gitea restart
|
||||||
```
|
```
|
||||||
|
|
|
@ -43,3 +43,23 @@ Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續
|
||||||
## 還原指令 (`restore`)
|
## 還原指令 (`restore`)
|
||||||
|
|
||||||
持續更新中: 此文件尚未完成.
|
持續更新中: 此文件尚未完成.
|
||||||
|
|
||||||
|
例:
|
||||||
|
```sh
|
||||||
|
unzip gitea-dump-1610949662.zip
|
||||||
|
cd gitea-dump-1610949662
|
||||||
|
mv data/conf/app.ini /etc/gitea/conf/app.ini
|
||||||
|
mv data/* /var/lib/gitea/data/
|
||||||
|
mv log/* /var/lib/gitea/log/
|
||||||
|
mv repos/* /var/lib/gitea/repositories/
|
||||||
|
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
|
||||||
|
|
||||||
|
# mysql
|
||||||
|
mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
|
||||||
|
# sqlite3
|
||||||
|
sqlite3 $DATABASE_PATH <gitea-db.sql
|
||||||
|
# postgres
|
||||||
|
psql -U $USER -d $DATABASE < gitea-db.sql
|
||||||
|
|
||||||
|
service gitea restart
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue