Schlagwort-Archive: PostgreSQL

Migrate paperless-ngx from PostgreSQL to sqlite

#insert reasons (e.g. simpler backup)

My reason is that I consider switching from a docker install with PostgreSQL to https://github.com/alexbelgium/hassio-addons/blob/master/paperless_ngx because the new (2.0+) versions of paperless (docker) removed the support for arm-32.

Inspired by https://github.com/jonaswinkler/paperless-ng/issues/1550#issuecomment-1015784199

Also sqlite is not slow: https://litestream.io/blog/why-i-built-litestream/

1. Export the database
(Data is exported into your „export“ folder)

usr/src/paperless/src#:
python3 manage.py dumpdata --exclude=contenttypes --exclude=auth.Permission > /usr/src/paperless/export/data.json

2. Stop the app, Remove the database from your docker compose file and start the app again.

3. Import the data

usr/src/paperless/src#:
python3 manage.py loaddata --exclude=contenttypes --exclude=auth.Permission /usr/src/paperless/export/data.json