@@ -67,7 +67,7 @@ func runRestore(ctx *cli.Context) error {
67
67
srcPath := os .Args [2 ]
68
68
69
69
zip .Verbose = ctx .Bool ("verbose" )
70
- log .Printf ("Extracting %s to tmp work dir " , srcPath )
70
+ log .Printf ("Extracting %s to %s " , srcPath , tmpWorkDir )
71
71
err = zip .ExtractTo (srcPath , tmpWorkDir )
72
72
if err != nil {
73
73
log .Fatalf ("Failed to extract %s to tmp work directory: %v" , srcPath , err )
@@ -101,7 +101,12 @@ func runRestore(ctx *cli.Context) error {
101
101
log .Fatalf ("Failed to SetEngine: %v" , err )
102
102
}
103
103
104
- log .Printf ("Restoring repo dir %s ..." , setting .RepoRootPath )
104
+ err = models .SyncDBStructs ()
105
+ if err != nil {
106
+ log .Fatalf ("Failed to SyncDBStructs: %v" , err )
107
+ }
108
+
109
+ log .Printf ("Restoring repo dir to %s ..." , setting .RepoRootPath )
105
110
repoPath := filepath .Join (tmpWorkDir , "repositories" )
106
111
err = os .RemoveAll (setting .RepoRootPath )
107
112
if err != nil {
@@ -113,7 +118,7 @@ func runRestore(ctx *cli.Context) error {
113
118
log .Fatalf ("Failed to move %s to %s: %v" , repoPath , setting .RepoRootPath , err )
114
119
}
115
120
116
- log .Printf ("Restoring custom dir %s ..." , setting .CustomPath )
121
+ log .Printf ("Restoring custom dir to %s ..." , setting .CustomPath )
117
122
customPath := filepath .Join (tmpWorkDir , "custom" )
118
123
err = os .RemoveAll (setting .CustomPath )
119
124
if err != nil {
@@ -125,7 +130,7 @@ func runRestore(ctx *cli.Context) error {
125
130
log .Fatalf ("Failed to move %s to %s: %v" , customPath , setting .CustomPath , err )
126
131
}
127
132
128
- log .Printf ("Restoring data dir %s ..." , setting .AppDataPath )
133
+ log .Printf ("Restoring data dir to %s ..." , setting .AppDataPath )
129
134
dataPath := filepath .Join (tmpWorkDir , "data" )
130
135
err = os .RemoveAll (setting .AppDataPath )
131
136
if err != nil {
@@ -137,8 +142,8 @@ func runRestore(ctx *cli.Context) error {
137
142
log .Fatalf ("Failed to move %s to %s: %v" , dataPath , setting .AppDataPath , err )
138
143
}
139
144
140
- log .Printf ("Restoring database from ..." )
141
145
dbPath := filepath .Join (tmpWorkDir , "database" )
146
+ log .Printf ("Restoring database from %s ..." , dbPath )
142
147
err = models .RestoreDatabaseFixtures (dbPath )
143
148
if err != nil {
144
149
log .Fatalf ("Failed to restore database dir %s: %v" , dbPath , err )
0 commit comments