Migration Extension

Sometimes, users may want to move their data from one instance to another. This could be due to a change in administration, a desire to be closer to friends, or any other reason. Migration can be done using the migration extension.

Behaviour

Migration happens in three steps:

Prepare the New Account

  • The user creates an account on the new instance, and puts the URI of the old account in the previous field of the new account.

Request Migration

  • The user requests migration from the old instance. The old instance checks that the previous field is set, and creates a migration entity.

  • The migration entity is then distributed to every instance that interacts with the old instance, including the new instance.

  • All instances that receive a verified migration entity (i.e. one where the previous field is correctly set on the new account) and support migration must then move all relationships (followers, followings, etc) from the old account to the new account in their internal database.

Complete Migration

  • The old instance sets the new field of the user to the URI of the new account, and marks it as "disabled" in its internal database.

Entity Definition

  • Name
    uri
    Type
    null
    Description

    This entity does not have a URI.

  • Name
    type
    Required
    Required
    Type
    string
    Description

    Must be pub.versia:migration/Migration.

  • Name
    author
    Required
    Required
    Type
    URI
    Description

    URI of the User who is migrating.

  • Name
    destination
    Required
    Required
    Type
    URI
    Description

    URI of the destination User on the new instance.

Example Entity

{
    "id": "016f3de2-ad63-4e06-999e-1e6b41c981c5",
    "type": "pub.versia:migration/Migration",
    "author": "https://example.com/users/44df6e02-ef43-47e0-aff2-47041f3d09ed",
    "created_at": "2021-01-01T00:00:00.000Z",
    "destination": "https://otherinstance.social/users/73e999a0-53d0-40a3-a5cc-be0408004726",
}

User Extensions

The following extensions to User are used by the migration extension:

  • Name
    previous
    Required
    Required
    Type
    URI
    Description

    If this user has migrated from another instance, this property MUST be set to the URI of the user on the previous instance.

  • Name
    new
    Type
    URI
    Description

    If this user has migrated to another instance, this property MUST be set to the URI of the user on the new instance.

Example

{
    // ...
    "type": "User",
    // ...
    "extensions": { 
        "pub.versia:migration": {
            "previous": "https://oldinstance.social/users/44df6e02-ef43-47e0-aff2-47041f3d09ed",
            // "new": "https://newinstance.social/users/73e999a0-53d0-40a3-a5cc-be0408004726",
        } 
    }
}