Skip to content

Pod portability: restore from export, rename, cross-origin migration #354

Open

Description

@melvincarvalho

Summary

Once an authenticated user can export their pod (#353), the natural next step is being able to put it back. This issue tracks the inverse: importing a previously-exported pod, optionally relocating it to a different WebID. Solid has long promised "you own your data, switch providers anytime" — this is the JSS-side delivery of that promise.

The space splits into three difficulty tiers. File as one issue with explicit phases so the easy part can ship without waiting on the hard part.

Phase 1 — Restore at the same WebID (easy)

The straight inverse of #353: same origin, same WebID, fresh server. Operator (or self-service later) uploads the tar.gz from #353 and JSS reconstructs the pod and seeds the IDP account.

POST /idp/account/import
Content-Type: application/x-tar+gzip
Authorization: <admin/operator> or boot-time CLI

→ 201 Created

CLI shape:

jss account import <archive.tar.gz> [--password <pw>]

Implementation:

This phase is essentially the inverse of the export and stays within established JSS abstractions.

Phase 2 — Move within the same origin (rename) (medium)

E.g. /me/ → / (which we did by hand in the #348 migration), or /alice/ → /bob/. Same server, different mount path.

What this actually entails — derived from the manual migration we performed during #348:

  1. Move filesystem tree to the new mount path (handling dotfiles correctly — .acl, .meta, .quota.json).
  2. Rewrite absolute URIs in every pod resource that references the old WebID prefix: .acl files, profile card.jsonld, publicTypeIndex, privateTypeIndex, prefs, plus any user content that hard-coded their own URI.
  3. Update the IDP account record (webId field) and the _webid_index.json index.
  4. Invalidate any active OIDC sessions/refresh tokens bound to the old WebID.

CLI shape:

jss account rename <old-webid> <new-webid>

Implementation:

  • Identify all RDF-bearing files (*.acl, *.jsonld, *.ttl, *.n3).
  • Stream-replace the WebID prefix; keep a dry-run mode that just lists changes for inspection.
  • Refuse to clobber an existing account at the new WebID.

Phase 3 — Cross-origin migration (hard, partial only)

https://oldserver.example/alice/ → https://newserver.example/alice/. The on-disk part is mechanically the same as Phase 2 with a different prefix. The hard parts can't be solved server-side:

  • Federation references: ActivityPub followers, Nostr relays, every consumer of the old WebID still has the old URI. There is no protocol-level "redirect my WebID" handshake in widely deployed Solid or AP. Best the source server can do is post a tombstone document at the old WebID pointing at the new one (<> pim:storage <https://newserver…>) and hope clients honour it. Most won't.
  • OIDC trust: clients that registered against the old issuer have no way to follow the move. They re-register against the new issuer.
  • Cached WebIDs: indefinite, server can't reach them.

Scope this phase as: provide the tools that can work (filesystem move + URI rewrite), document the federation/OIDC limitations explicitly, and add a tombstone mode at the old origin that:

  • Returns 410 Gone on every pod resource except…
  • GET /profile/card.jsonld which serves a redirect document linking to the new WebID.

Operators with cooperating clients can use this; everyone else has to update by hand. That's the honest answer.

Out of scope

  • Real-time replication / pod sync between two live JSS instances (separate feature, different problem).
  • Solid Pod Portability spec alignment — track if/when there's a stable spec; for now JSS does what's pragmatic.
  • Re-encrypting at-rest data for cross-server moves where the destination has different storage encryption (we don't have at-rest encryption today; revisit when we do).

Acceptance

Phase 1:

Phase 2:

Phase 3:

  • Cross-origin documented limits called out in docs/configuration.md.
  • Tombstone-mode flag/CLI lets the old origin redirect at the WebID and 410 elsewhere.
  • Tests cover the redirect document shape, not the federation-reach problem (we can't test what we can't fix).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions