Skip to content

Commit a09ba3d

Browse files
committed
Docs - Docker - add backups dir volume
1 parent 9b88054 commit a09ba3d

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

docs/content/backup_restore.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ but also a tiny backups manager which handle backup files for you.
88
The backup command will use the [predefined or configured binary](./configuration/basics#binaries) for your
99
database vendor with correct parameters to dump your database.
1010

11-
Each time you launch the backup command, [a backup file is stored in a directory](./configuration/basics#storage-directory) (See
11+
Each time you launch the backup command, [a backup file is stored in a directory](./configuration/basics#storage) (See
1212
[Storage section](#storage) below for more information on how backup files are stored).
1313

14-
With time, this directory will grow, that's why a [backup expiration age](./configuration/basics#storage-directory#backup-expiration-age)
14+
With time, this directory will grow, that's why a [backup expiration age](./configuration/basics#backup-expiration-age)
1515
was added. Every time you launch the command, at the end, it will be asked if you want to remove obsolete
1616
backup files (i.e. files that have passed their expiration date).
1717

@@ -337,13 +337,18 @@ docker compose run dbtools restore --ignore-default-options
337337
As mentioned earlier on this page, *DbToolsBundle* can list existing backup files
338338
when you want to restore a previous one with the restore command.
339339

340-
All backups are stored in a directory. By default this directory is <span db-tools-flavor="standalone-docker">`./var/db_tools` (relative to the yaml config file)</span><span db-tools-flavor="symfony">`%kernel.project_dir%/var/db_tools`</span>
341-
but [you can choose the directory you want](./configuration/basics#storage-directory).
340+
All backups are stored in a directory. By default this directory is
341+
<span db-tools-flavor="standalone">`./var/db_tools` (relative to the yaml config file)</span>
342+
<span db-tools-flavor="symfony">`%kernel.project_dir%/var/db_tools`</span>
343+
<span db-tools-flavor="docker">`/var/www/var/db_tools` (inside the docker container)</span>
344+
but [you can choose the directory you want](./configuration/basics#storage).
342345

343346
In this directory, each backup is put in sub-directories depending on the backup date. The backup's filename
344347
is generated from the backup date and the DBAL connection name of the database.
345348

346349
For a backup made the 2023-05-15 at 12:22:35 for the default connection, the filename will be :
347-
<span db-tools-flavor="standalone-docker">`./var/db_tools/2023/05/default-20230515122235.sql`</span><span db-tools-flavor="symfony">`%kernel.project_dir%/var/db_tools/2023/05/default-20230515122235.sql`</span>.
350+
<span db-tools-flavor="standalone">`./var/db_tools/2023/05/default-20230515122235.sql`</span>
351+
<span db-tools-flavor="symfony">`%kernel.project_dir%/var/db_tools/2023/05/default-20230515122235.sql`</span>
352+
<span db-tools-flavor="docker">`/var/www/var/db_tools/2023/05/default-20230515122235.sql`</span>.
348353

349354
Note that the file extension may vary depending on the database vendor.

docs/content/configuration/basics.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,16 @@ the option will inherit from the default.
9090
9191
Some options are available to customize how the `backup` command works.
9292

93-
### Storage
93+
### Storage {#storage}
9494

9595
#### Root directory
9696

9797
The `storage_directory` parameter let you choose where to put the generated dumps.
9898

99-
@@@ symfony
100-
Default value is `'%kernel.project_dir%/var/db_tools'`.
101-
@@@
102-
@@@ standalone docker
103-
Default value is `./var/db_tools'`.
104-
@@@
99+
Default value is
100+
<span db-tools-flavor="standalone">`./var/db_tools` (relative to the YAML config file)</span>
101+
<span db-tools-flavor="symfony">`%kernel.project_dir%/var/db_tools`</span>
102+
<span db-tools-flavor="docker">`/var/www/var/db_tools` (inside the docker container)</span>
105103

106104
#### File and directory naming strategy
107105

@@ -249,7 +247,7 @@ command using the `--exclude` option.
249247

250248
See the [default binary options](#default-binary-options) section.
251249

252-
### Backup expiration age
250+
### Backup expiration age {#backup-expiration-age}
253251

254252
The `backup_expiration_age` parameter let you choose when a backup is considered
255253
as obsolete.

docs/content/getting-started/installation.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Installation
22

3-
Installation method will depend on which flavor you want to use.
4-
5-
Select below your target:
3+
Installation method will depend on which flavor you want to use:
64

75
<FlavorSwitcher />
86

@@ -32,11 +30,9 @@ Currently supported database vendors:
3230
- MariaDB 10.11 and above
3331
- MySQL 5.7, 8.0 and above
3432
- SQLite 3.0 and above
35-
- SQL Server 2019 and above
36-
<br><small>(previous versions from 2015 are untested but should work)</small>
3733

3834
::: info
39-
The bundle could also work with other database vendors.
35+
The library could also work with other database vendors.
4036
Check out the [supported database vendors](../getting-started/database-vendors) page.
4137
:::
4238

@@ -91,17 +87,14 @@ cp vendor/makinacorpus/db-tools-bundle/config/packages/db_tools.yaml config/pack
9187
Feel free to read this configuration file, it will learn you basics about this bundle.
9288
@@@
9389
@@@ docker
94-
You can, for example, add the [*DbToolsBundle* image](https://hub.docker.com/r/makinacorpus/dbtoolsbundle) to your docker compose stack like this:
95-
90+
You can add the [*DbToolsBundle* image](https://hub.docker.com/r/makinacorpus/dbtoolsbundle) to your docker compose stack like in this example:
9691

9792
```yaml
9893
version: '3.8'
9994

10095
services:
10196
postgres:
102-
container_name: postgres
10397
image: postgres:15
104-
restart: always
10598
environment:
10699
POSTGRES_PASSWORD: password
107100
POSTGRES_DB: db
@@ -119,6 +112,7 @@ services:
119112
- site // [!code ++]
120113
volumes: // [!code ++]
121114
- ./db_tools.config.yaml:/var/www/db_tools.config.yaml // [!code ++]
115+
- ./db_tools:/var/www/var/db_tools // [!code ++]
122116

123117
networks:
124118
site:
@@ -135,15 +129,15 @@ cp vendor/makinacorpus/db-tools-bundle/config/db_tools.standalone.sample.yaml db
135129
```
136130

137131
Update this file to your needs. The only required parameter is `connections` in which you
138-
must provided a [URL connection string](../configuration/reference#connections).
132+
must provided a [connection string](../configuration/reference#connections).
139133

140134
In our example, the connection string will be `pgsql://db:password@postgres:5432/db?version=15.0`.
141135
@@@
142136

143137
**That's it, *DbToolsBundle* is now ready to be used.**
144138

145-
But before starting to use it, check if it succeeds to find backup and
146-
restoration binaries for your Doctrine connection(s):
139+
But before starting to use it, check if it succeeds to find back up and
140+
restoration binaries for your database connection(s):
147141

148142
@@@ standalone
149143
```sh

0 commit comments

Comments
 (0)