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
{{ message }}
This repository was archived by the owner on Feb 16, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 16, 2023. It is now read-only.
[Other] Convert from PostgreSQL back to SQLite? #1550
I had originally setup Paperless-ng with Postgres, however after using it for a few years my actual document-to-paperless use is less than anticipated, and I am trying to clean up my unused databases, and right now paperless-ng is the only Postgres database I have left, so I'd like to blow away postgres alltogether, but I would need to convert the data from Postgres back to SQLite. Is this possible?
You can also use the document exporter, change the database type and then import everything.
An example with docker.
All paperless container are running (db, webserver, redis). docker exec <container_name_webserver> document_exporter ../export.
The document exporter exports all your data from paperless into a folder for backup or migration to another DMS.
Change database configuration to sqlite.
Start a complete new paperless environment but mount the export folder to it.
Run the import command. docker exec <container_name_webserver> document_importer ../export
Activity
mskg commentedon Jan 18, 2022
The process described here https://paperless-ng.readthedocs.io/en/latest/setup.html also works in reverse.
CorneliousJD commentedon Jan 18, 2022
@mskg so if I try to run
python3 manage.py dumpdata --database=postgres --exclude=contenttypes --exclude=auth.Permission > data.jsonIt fails, I tried database=postgres, postgresql, pgsql and paperless (name of the DB)
It just says the connection postgress or paperless does not exist.
Any ideas on what command to run instead? Thanks in advance.
mskg commentedon Jan 18, 2022
manage dumpdata --exclude=contenttypes --exclude=auth.Permission > data.jsonthat exports the data using known database configurationCorneliousJD commentedon Jan 18, 2022
Thanks, that worked. Running now back on SQLite :)
Much appreciated.
DonkiKoi commentedon Jan 19, 2022
You can also use the document exporter, change the database type and then import everything.
An example with docker.
docker exec <container_name_webserver> document_exporter ../export.The document exporter exports all your data from paperless into a folder for backup or migration to another DMS.
docker exec <container_name_webserver> document_importer ../export