mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-17 18:46:35 +00:00
Stop services before database steps
This commit is contained in:
parent
dba5bc01a2
commit
ed90a23830
@ -18,6 +18,14 @@ reset your database. If you are comfortable with Django you can export and re-im
|
|||||||
existing database data with:
|
existing database data with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Stop services
|
||||||
|
$ docker exec -t tubesync \
|
||||||
|
bash -c 'for svc in \
|
||||||
|
/run/service/{gunicorn,tubesync*-worker} ; \
|
||||||
|
do \
|
||||||
|
/command/s6-svc -wd -D "${svc}" ; \
|
||||||
|
done'
|
||||||
|
# Backup the database into a compressed file
|
||||||
$ docker exec -t tubesync \
|
$ docker exec -t tubesync \
|
||||||
python3 /app/manage.py \
|
python3 /app/manage.py \
|
||||||
dumpdata --format jsonl \
|
dumpdata --format jsonl \
|
||||||
@ -41,6 +49,14 @@ If you use `-` as the destination, then `docker cp` provides a `tar` archive.
|
|||||||
After you have changed your database backend over, then use:
|
After you have changed your database backend over, then use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Stop services
|
||||||
|
$ docker exec -t tubesync \
|
||||||
|
bash -c 'for svc in \
|
||||||
|
/run/service/{gunicorn,tubesync*-worker} ; \
|
||||||
|
do \
|
||||||
|
/command/s6-svc -wd -D "${svc}" ; \
|
||||||
|
done'
|
||||||
|
# Load fixture file into the database
|
||||||
$ docker exec -t tubesync \
|
$ docker exec -t tubesync \
|
||||||
python3 /app/manage.py \
|
python3 /app/manage.py \
|
||||||
loaddata /downloads/tubesync-database-backup.jsonl.xz
|
loaddata /downloads/tubesync-database-backup.jsonl.xz
|
||||||
@ -48,6 +64,14 @@ $ docker exec -t tubesync \
|
|||||||
|
|
||||||
Or, if you only have the copy in `/tmp/`, then you would use:
|
Or, if you only have the copy in `/tmp/`, then you would use:
|
||||||
```bash
|
```bash
|
||||||
|
# Stop services
|
||||||
|
$ docker exec -t tubesync \
|
||||||
|
bash -c 'for svc in \
|
||||||
|
/run/service/{gunicorn,tubesync*-worker} ; \
|
||||||
|
do \
|
||||||
|
/command/s6-svc -wd -D "${svc}" ; \
|
||||||
|
done'
|
||||||
|
# Load fixture data from standard input into the database
|
||||||
$ xzcat /tmp/tubesync-database-backup.jsonl.xz | \
|
$ xzcat /tmp/tubesync-database-backup.jsonl.xz | \
|
||||||
docker exec -i tubesync \
|
docker exec -i tubesync \
|
||||||
python3 /app/manage.py \
|
python3 /app/manage.py \
|
||||||
|
Loading…
Reference in New Issue
Block a user