Data export and import
Learn how to export and import your Pocket ID data for backup or migration
The Pocket ID CLI lets you export and import your Pocket ID data. This is useful when creating backups, moving an installation to another instance, or switching database providers.
Exporting Data
Section titled “Exporting Data”Use the export command to create a backup file:
pocket-id export --path ./path/to/export.zipExporting to standard output
Section titled “Exporting to standard output”You can pass --path - to write the export to standard output. This is helpful when piping the archive or working with Docker:
pocket-id export --path - > ./path/to/export.zipExport with Docker
Section titled “Export with Docker”Exporting to standard output is often the simplest approach when running Pocket ID in Docker:
docker compose exec -T pocket-id ./pocket-id export --path - > ./path/to/export.zipImporting Data
Section titled “Importing Data”- Shut down your Pocket ID instance.
- Use the import command to restore a previously exported archive:
pocket-id import --path ./path/to/export.zipImporting from standard input
Section titled “Importing from standard input”Like export, you can use --path - to read from standard input:
pocket-id import --yes --path - < ./path/to/export.zipWhen importing from standard input, you must include --yes to confirm the operation without a prompt. The following prompt cannot be shown when reading from standard input:
WARNING: This feature is experimental and may not work correctly. Please create a backup before proceeding and report any issues you encounter.
WARNING: Import will erase all existing data at the following locations:Database: /app/data/pocket-id.dbUploads Path: /app/data/uploadsDo you want to continue? [y/N]:Import with Docker
Section titled “Import with Docker”When using Docker, importing from standard input is often the easiest method:
cat ./export.zip | docker compose run -T pocket-id ./pocket-id import --yes --path -The -T flag disables TTY allocation. Without it, Docker fails with the input device is not a TTY when piping data into the container, and binary output from the export may be corrupted.