Skip to content

Commit b714354

Browse files
committed
Enhance backup and restore instructions for Docker
Clarified instructions for creating and restoring database dumps in Docker environments, including specific commands for host system and Docker Desktop.
1 parent 7726da1 commit b714354

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/content/docs/administration/backup.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,24 @@ a dump every two hours. See [configuration](https://github.com/databacker/mysql-
1313

1414
The automatically created backups are located in the [`backups` directory](/administration/docker/) of the docker configuration package.
1515

16-
You can explicitly create a dump of your dockerized database while the docker containers are running using the command:
16+
#### When using Docker
17+
18+
You can explicitly create a dump of your dockerized database while the docker containers are running using the command on your host system shell:
19+
20+
```shell
21+
docker exec mysql mysqldump -u root -p123456 archivesspace | gzip > /tmp/db.$(date +%F.%H%M%S).sql.gz
22+
```
23+
24+
#### When using Docker Desktop
25+
26+
You can explicitly create a dump of your dockerized database while the docker containers are running using the command on the "Exec" tab of your mysql container:
1727

1828
```shell
1929
docker exec mysql mysqldump -u root -p123456 archivesspace | gzip > /tmp/db.$(date +%F.%H%M%S).sql.gz
2030
```
2131

32+
You can then export the created database dump from the `/tmp` directory of your mysql container using the "Files" tab.
33+
2234
## Managing your own backups
2335

2436
Performing regular backups of your MySQL database is critical. ArchivesSpace stores
@@ -133,8 +145,16 @@ cp -a /unpacked/zip/demo_db_backups/demo_db_backup_1373323208_25926/archivesspac
133145

134146
#### When running on Docker
135147

136-
If you are using the Docker configuration package to run ArchivesSpace you can restore a database dump onto your `archivesspace` MySQL database with the following command:
148+
If you are using the Docker configuration package to run ArchivesSpace you can restore a database dump onto your `archivesspace` MySQL database with the following command on your host system shell:
137149

138150
```shell
139151
docker exec mysql mysql -uas -pas123 archivesspace < /tmp/db.2025-02-26.164907.sql
140152
```
153+
154+
##### When using Docker Desktop
155+
156+
On docker Desktop, you can import your sql file into the `/tmp/` directrory using the "Files" tab of your mysql container. Afterwards, on the "Exec" tab run the command:
157+
158+
```shellgunzip -c /tmp/db.2026-02-17.155254.sql.gz | mysql -uas -pas123 archivesspace
159+
gunzip -c /tmp/db.2026-02-17.155254.sql.gz | mysql -uas -pas123 archivesspace
160+
```

0 commit comments

Comments
 (0)