As an atproto service, we will face situations where we need all users to migrate their existing records to new collection/lexicon schema.
For example,
- #294 will merge two different
repo.*.commentcollections into onefeed.comment - There is ongoing discussion to use did for repositories, which might require all users to migrate their existing records.
To support this, it will be really convenient if we have a generalized user data migration UI.
Implementation#
Similar to DB migration but it opposite way, the appview will have atproto_need_migrations table holding user did & migration name. When we change lexicon NSID or schema in backwards incompatible way, we will list all authors of legacy records to the atproto_need_migrations table. So when listed user logs in, we will show them about the need of record migrations on banner. Which navigates to a dedicated page.
In most cases, we can just drop the legacy table as the data is atprotated. We can refetch them when the user migrate their legacy records.
why not just automatically run the migration of records in the background upon login?
i personally do believe that migrating records is essential. but realistically; this will not happen for all users that have created tangled records. we should therefore announce a date on which we stabilize records; and that would be the earliest date for which network-wide backfill is valid + supported
or write appview code to handle ingestion of backward incompatible changes:
this way backfill can be run from older dates.