You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-3
Original file line number
Diff line number
Diff line change
@@ -198,7 +198,6 @@ To use this image with [Firebird Events](https://firebirdsql.org/file/documentat
198
198
- [Publish](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/) this port to the host.
199
199
200
200
More information:
201
-
202
201
- [This answer](https://stackoverflow.com/a/49918178/33244) from Mark Rotteveel at Stack Overflow.
203
202
- [The Power of Firebird Events](https://www.firebirdsql.org/file/documentation/papers_presentations/Power_Firebird_events.pdf) from Milan Babuškov.
204
203
@@ -210,7 +209,7 @@ When creating a new database with `FIREBIRD_DATABASE` environment variable you c
210
209
211
210
Any file with extensions `.sh`, `.sql`, `.sql.gz`, `.sql.xz` and `.sql.zst` found in `/docker-entrypoint-initdb.d/` will be executed in _alphabetical_ order. `.sh` files without file execute permission (`+x`) will be _sourced_ rather than executed.
212
211
213
-
**IMPORTANT:** Scripts will only run if you start the container with a data directory that is empty. Any pre-existing database will be left untouched on container startup.
212
+
> **IMPORTANT:** Scripts will only run if you start the container with a data directory that is empty. Any pre-existing database will be left untouched on container startup.
214
213
215
214
216
215
@@ -231,6 +230,68 @@ Alternatively, you can use the same time zone as your host system by mapping the
231
230
- /etc/timezone:/etc/timezone:ro
232
231
```
233
232
233
+
234
+
235
+
## Backup and Restore
236
+
237
+
### For online databases
238
+
239
+
If the database is in use, call `gbak` inside the running container using Firebird Service Manager (`-se` switch) for best performance.
240
+
241
+
The following commands will backup and restore a database **in the data directory** (`/var/lib/firebird/data`) of the running container.
> **IMPORTANT:** > Never use this with online (running) database files.
266
+
267
+
If you don't have a running server, create an ephemeral container to run `gbak` directly over the database files.
268
+
269
+
The following commands will backup and restore a database **in the current directory** (`$PWD`).
270
+
271
+
```bash
272
+
# Offline backup
273
+
FIREBIRD_IMAGE=firebirdsql/firebird
274
+
DATABASE_FILE=MY_DATABASE.fdb
275
+
BACKUP_FILE=MY_DATABASE.fbk
276
+
277
+
docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -b /pwd/$DATABASE_FILE /pwd/$BACKUP_FILE
278
+
```
279
+
280
+
```bash
281
+
# Offline restore
282
+
FIREBIRD_IMAGE=firebirdsql/firebird
283
+
BACKUP_FILE=MY_DATABASE.fbk
284
+
DATABASE_FILE=MY_DATABASE.fdb
285
+
286
+
docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -c /pwd/$BACKUP_FILE /pwd/$DATABASE_FILE
287
+
```
288
+
289
+
More information:
290
+
- [Firebird’s gbak Backup and Restore Utility](https://firebirdsql.org/file/documentation/html/en/firebirddocs/gbak/firebird-gbak.html) from Norman Dunbar and Mark Rotteveel.
291
+
- [Quick Guide for Gbak Backup-Restore](https://ib-aid.com/articles/firebird-gbak-backup-tips-and-tricks) from IBSurgeon.
292
+
293
+
294
+
234
295
# Development notes
235
296
236
297
## Prerequisites
@@ -264,4 +325,3 @@ To run the test suite for each image, use:
Copy file name to clipboardExpand all lines: src/README.md.template
+63-2
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,6 @@ To use this image with [Firebird Events](https://firebirdsql.org/file/documentat
144
144
- [Publish](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/) this port to the host.
145
145
146
146
More information:
147
-
148
147
- [This answer](https://stackoverflow.com/a/49918178/33244) from Mark Rotteveel at Stack Overflow.
149
148
- [The Power of Firebird Events](https://www.firebirdsql.org/file/documentation/papers_presentations/Power_Firebird_events.pdf) from Milan Babuškov.
150
149
@@ -156,7 +155,7 @@ When creating a new database with `FIREBIRD_DATABASE` environment variable you c
156
155
157
156
Any file with extensions `.sh`, `.sql`, `.sql.gz`, `.sql.xz` and `.sql.zst` found in `/docker-entrypoint-initdb.d/` will be executed in _alphabetical_ order. `.sh` files without file execute permission (`+x`) will be _sourced_ rather than executed.
158
157
159
-
**IMPORTANT:** Scripts will only run if you start the container with a data directory that is empty. Any pre-existing database will be left untouched on container startup.
158
+
> **IMPORTANT:** Scripts will only run if you start the container with a data directory that is empty. Any pre-existing database will be left untouched on container startup.
160
159
161
160
162
161
@@ -177,6 +176,68 @@ Alternatively, you can use the same time zone as your host system by mapping the
177
176
- /etc/timezone:/etc/timezone:ro
178
177
```
179
178
179
+
180
+
181
+
## Backup and Restore
182
+
183
+
### For online databases
184
+
185
+
If the database is in use, call `gbak` inside the running container using Firebird Service Manager (`-se` switch) for best performance.
186
+
187
+
The following commands will backup and restore a database **in the data directory** (`/var/lib/firebird/data`) of the running container.
> **IMPORTANT:** > Never use this with online (running) database files.
212
+
213
+
If you don't have a running server, create an ephemeral container to run `gbak` directly over the database files.
214
+
215
+
The following commands will backup and restore a database **in the current directory** (`$PWD`).
216
+
217
+
```bash
218
+
# Offline backup
219
+
FIREBIRD_IMAGE=firebirdsql/firebird
220
+
DATABASE_FILE=MY_DATABASE.fdb
221
+
BACKUP_FILE=MY_DATABASE.fbk
222
+
223
+
docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -b /pwd/$DATABASE_FILE /pwd/$BACKUP_FILE
224
+
```
225
+
226
+
```bash
227
+
# Offline restore
228
+
FIREBIRD_IMAGE=firebirdsql/firebird
229
+
BACKUP_FILE=MY_DATABASE.fbk
230
+
DATABASE_FILE=MY_DATABASE.fdb
231
+
232
+
docker run --rm -v .:/pwd $FIREBIRD_IMAGE gbak -c /pwd/$BACKUP_FILE /pwd/$DATABASE_FILE
233
+
```
234
+
235
+
More information:
236
+
- [Firebird’s gbak Backup and Restore Utility](https://firebirdsql.org/file/documentation/html/en/firebirddocs/gbak/firebird-gbak.html) from Norman Dunbar and Mark Rotteveel.
237
+
- [Quick Guide for Gbak Backup-Restore](https://ib-aid.com/articles/firebird-gbak-backup-tips-and-tricks) from IBSurgeon.
0 commit comments