mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-19 19:46:37 +00:00
Merge pull request #1016 from tcely/patch-2
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Add more details about saving database entries
This commit is contained in:
commit
dba5bc01a2
@ -18,22 +18,49 @@ reset your database. If you are comfortable with Django you can export and re-im
|
||||
existing database data with:
|
||||
|
||||
```bash
|
||||
$ docker exec -i tubesync python3 /app/manage.py dumpdata > some-file.json
|
||||
$ docker exec -t tubesync \
|
||||
python3 /app/manage.py \
|
||||
dumpdata --format jsonl \
|
||||
--exclude background_task \
|
||||
--output /downloads/tubesync-database-backup.jsonl.xz
|
||||
```
|
||||
|
||||
Then change you database backend over, then use
|
||||
Writing the compressed backup file to your `/downloads/` makes sense, as long as that directory is still available after destroying the current container.
|
||||
If you have a configuration where that file will be deleted, choose a different place to store the output (perhaps `/config/`, if it has sufficient storage available) and place the file there instead.
|
||||
|
||||
You can also copy the file from the container to the local filesystem (`/tmp/` in this example) with:
|
||||
|
||||
```bash
|
||||
$ cat some-file.json | docker exec -i tubesync python3 /app/manage.py loaddata - --format=json
|
||||
$ docker cp \
|
||||
tubesync:/downloads/tubesync-database-backup.jsonl.xz \
|
||||
/tmp/
|
||||
```
|
||||
|
||||
If you use `-` as the destination, then `docker cp` provides a `tar` archive.
|
||||
|
||||
After you have changed your database backend over, then use:
|
||||
|
||||
```bash
|
||||
$ docker exec -t tubesync \
|
||||
python3 /app/manage.py \
|
||||
loaddata /downloads/tubesync-database-backup.jsonl.xz
|
||||
```
|
||||
|
||||
Or, if you only have the copy in `/tmp/`, then you would use:
|
||||
```bash
|
||||
$ xzcat /tmp/tubesync-database-backup.jsonl.xz | \
|
||||
docker exec -i tubesync \
|
||||
python3 /app/manage.py \
|
||||
loaddata --format=jsonl -
|
||||
```
|
||||
|
||||
As detailed in the Django documentation:
|
||||
|
||||
https://docs.djangoproject.com/en/3.1/ref/django-admin/#dumpdata
|
||||
https://docs.djangoproject.com/en/5.1/ref/django-admin/#dumpdata
|
||||
|
||||
and:
|
||||
|
||||
https://docs.djangoproject.com/en/3.1/ref/django-admin/#loaddata
|
||||
https://docs.djangoproject.com/en/5.1/ref/django-admin/#loaddata
|
||||
|
||||
Further instructions are beyond the scope of TubeSync documenation and you should refer
|
||||
to Django documentation for more details.
|
||||
@ -94,7 +121,7 @@ the DB for the performance benefits, a configuration like this would be enough:
|
||||
|
||||
```
|
||||
tubesync-db:
|
||||
image: postgres:15.2
|
||||
image: postgres:17
|
||||
container_name: tubesync-db
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
|
Loading…
Reference in New Issue
Block a user