This repository was archived by the owner on Dec 2, 2017. It is now read-only.
File tree 1 file changed +45
-0
lines changed 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ date : " 2017-01-01T16:00:00+02:00"
3
+ title : " 用法: 備份與還原"
4
+ slug : " backup-and-restore"
5
+ weight : 11
6
+ toc : true
7
+ draft : false
8
+ menu :
9
+ sidebar :
10
+ parent : " usage"
11
+ name : " 備份與還原"
12
+ weight : 11
13
+ identifier : " backup-and-restore"
14
+ ---
15
+
16
+ # 備份與還原
17
+
18
+ Gitea 目前支援 ` dump ` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。
19
+
20
+ ## 備份指令 (` dump ` )
21
+
22
+ 首先,切換到執行 Gitea 的使用者: ` su git ` (請修改成您指定的使用者),並在安裝目錄內執行 ` ./gitea dump ` 指令,你可以看到 console 畫面如下:
23
+
24
+ ```
25
+ 2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
26
+ 2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
27
+ 2016/12/27 22:32:22 Dumping database...
28
+ 2016/12/27 22:32:22 Packing dump files...
29
+ 2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
30
+ 2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
31
+ ```
32
+
33
+ 備份出來的 ` gitea-dump-1482906742.zip ` 檔案,檔案內會包含底下內容:
34
+
35
+ * ` custom/conf/app.ini ` - 伺服器設定檔。
36
+ * ` gitea-db.sql ` - SQL 備份檔案。
37
+ * ` gitea-repo.zip ` - 此 zip 檔案為全部的 repo 目錄。
38
+ 請參考 Config -> repository -> ` ROOT ` 所設定的路徑。
39
+ * ` log/ ` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。
40
+
41
+ 你可以透過設定 ` --tempdir ` 指令參數來指定備份檔案目錄,或者是設定 ` TMPDIR ` 環境變數來達到此功能。
42
+
43
+ ## 還原指令 (` restore ` )
44
+
45
+ 持續更新中: 此文件尚未完成.
You can’t perform that action at this time.
0 commit comments