mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 08:49:38 +03:00
[PR #998] [MERGED] feat: add CLI command for importing and exporting Pocket ID data #1020
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/998
Author: @stonith404
Created: 10/2/2025
Status: ✅ Merged
Merged: 11/26/2025
Merged by: @stonith404
Base:
breaking/v2← Head:feat/data-export-import📝 Commits (10+)
c822feafeat: add CLI command for importing and exporting Pocket ID data847c744undo accidental connection string changef333ff7fix linter issue5995a33return error early if pocket id version is too low32de502fix error handling01225f0Merge branch 'main' into feat/data-export-importa47a017enable triggers again for postgres34b29c6prevent zip slip and fail early if file too largedda6dc8don't handle json specially9e764e6don't encode html in json📊 Changes
56 files changed (+3259 additions, -806 deletions)
View changed files
📝
.github/workflows/e2e-tests.yml(+15 -2)📝
.gitignore(+1 -0)📝
backend/go.mod(+1 -4)📝
backend/go.sum(+6 -91)📝
backend/internal/bootstrap/bootstrap.go(+69 -38)📝
backend/internal/bootstrap/db_bootstrap.go(+3 -99)📝
backend/internal/bootstrap/e2etest_router_bootstrap.go(+1 -1)📝
backend/internal/bootstrap/router_bootstrap.go(+1 -10)📝
backend/internal/bootstrap/services_bootstrap.go(+2 -0)➕
backend/internal/cmds/export.go(+70 -0)➕
backend/internal/cmds/import.go(+191 -0)📝
backend/internal/cmds/key_rotate.go(+2 -1)📝
backend/internal/cmds/root.go(+4 -3)📝
backend/internal/controller/e2etest_controller.go(+5 -2)📝
backend/internal/model/types/date_time.go(+9 -0)➕
backend/internal/service/app_lock_service.go(+296 -0)➕
backend/internal/service/app_lock_service_test.go(+189 -0)📝
backend/internal/service/e2etest_service.go(+42 -41)➕
backend/internal/service/export_service.go(+217 -0)➕
backend/internal/service/import_service.go(+264 -0)...and 36 more files
📄 Description
This PR introduces two new commands (
importandexport) to the CLI. With these two commands all Pocket ID data, including the uploaded images, keys and database content can be exported to a ZIP file which then can be imported to a new instance.Docker Image:
ghcr.io/pocket-id/pocket-id:pr-998Closes #721
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.