Migrate Paperless-ngx to a new Docker container

#paperless #selfhosting #backup


Connect to the container terminal

docker exec -it paperless /bin/bash

Create a folder for the export

mkdir data/export

Run the built-in document exporter

run document_exporter ./data/export

And then exit the terminal

exit

Create a local folder for the exported data

mkdir ./export

Copy the exported data from the Paperless-ngx volume to the local export folder

docker run --rm -v ./export:/export -v paperless-data:/data alpine cp -R /data/export /export 

Do the reverse to copy data to the new Paperless-ngx volume

Use the built-in document_importer to import the files to the new instance.