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
ShipNode can install a small remote backup script and a systemd timer that dumps the configured PostgreSQL, MySQL, or SQLite database, compresses it, and uploads it to S3.
635
+
636
+
```bash
637
+
DB_BACKUP_ENABLED=true
638
+
DB_BACKUP_S3_BUCKET=my-backups
639
+
DB_BACKUP_S3_PREFIX=myapp/production
640
+
DB_BACKUP_SCHEDULE=daily
641
+
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
642
+
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
643
+
AWS_DEFAULT_REGION=eu-west-1
619
644
```
620
645
646
+
Put real AWS/S3 credentials in `.env`, upload them with `shipnode env`, then configure backups:
647
+
648
+
```bash
649
+
shipnode setup
650
+
shipnode backup setup
651
+
shipnode backup run
652
+
shipnode backup status
653
+
```
654
+
655
+
Use `DB_BACKUP_S3_ENDPOINT` for S3-compatible storage such as Cloudflare R2, MinIO, or DigitalOcean Spaces. `DB_BACKUP_RETENTION_DAYS` controls local compressed files on the server; use your bucket lifecycle policy for S3 retention.
Copy file name to clipboardExpand all lines: docs/advanced/architecture.md
+48-27Lines changed: 48 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This document describes the internal architecture and module organization of Shi
6
6
7
7
ShipNode is organized as a modular bash project to improve maintainability, testability, and collaboration. The codebase is split into focused modules, each with a single responsibility.
Copy file name to clipboardExpand all lines: docs/guides/configuration/shipnode-conf.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,31 @@ DB_PASSWORD=${DB_PASSWORD:-}
101
101
102
102
`DB_TYPE` can be `postgresql`, `mysql`, or `sqlite`. PostgreSQL/MySQL setup installs the server if missing, starts/enables it, creates the database/user, and grants privileges. SQLite setup installs `sqlite3` and creates a database file at `DB_SQLITE_PATH`, defaulting to `$REMOTE_PATH/shared/database.sqlite`. Keep SQLite files under `shared/`; ShipNode rejects paths inside `current/` or `releases/`.
103
103
104
+
### Database Backups to S3
105
+
106
+
Enable backups when ShipNode should dump the configured database and upload compressed files to S3 on a schedule:
107
+
108
+
```bash
109
+
DB_BACKUP_ENABLED=true
110
+
DB_BACKUP_S3_BUCKET=my-backups
111
+
DB_BACKUP_S3_PREFIX=myapp/production
112
+
DB_BACKUP_SCHEDULE=daily
113
+
DB_BACKUP_RETENTION_DAYS=14
114
+
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
115
+
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
116
+
AWS_DEFAULT_REGION=eu-west-1
117
+
```
118
+
119
+
Put the real `AWS_*` values in `.env`, upload them with `shipnode env`, then run:
120
+
121
+
```bash
122
+
shipnode backup setup
123
+
shipnode backup run
124
+
shipnode backup status
125
+
```
126
+
127
+
`DB_BACKUP_SCHEDULE` accepts `hourly`, `daily`, `weekly`, or a systemd `OnCalendar` expression. Set `DB_BACKUP_S3_ENDPOINT` for S3-compatible providers.
Copy file name to clipboardExpand all lines: docs/reference/configuration-reference.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,37 @@ Run schema migrations from `.shipnode/pre-deploy.sh`; database creation and migr
129
129
130
130
Keep SQLite files under `shared/` so they survive release switches and cleanup. ShipNode rejects paths inside `$REMOTE_PATH/current/` or `$REMOTE_PATH/releases/`.
131
131
132
+
### Database Backups
133
+
134
+
When `DB_BACKUP_ENABLED=true`, `shipnode setup` and `shipnode backup setup` install a remote backup script at `$REMOTE_PATH/shared/shipnode-backup.sh` and enable a systemd timer. Backups are compressed locally, uploaded to S3, and can be run manually with `shipnode backup run`.
Store real credentials in `.env`, run `shipnode env`, then run `shipnode backup setup`. S3 object retention should be managed with bucket lifecycle rules; ShipNode only prunes local compressed files.
0 commit comments