{#if flow.state.step !== 'welcome'}
{#each steps as stepName, i}
{i < getCurrentStepIndex() ? '✓' : i + 1}
{stepName}
{#if i < steps.length - 1}
{/if} {/each}
{/if} {#if flow.state.error}
{flow.state.error}
{/if} {#if flow.state.step === 'welcome'}

Migrate Your Account Away

This wizard will help you move your AT Protocol account from this PDS to another one.

{#if isDidWeb()}
did:web Migration Notice

Your account uses a did:web identifier ({auth.session?.did}). After migrating, this PDS will continue serving your DID document with an updated service endpoint pointing to your new PDS.

You can return here anytime to update the forwarding if you migrate again in the future.

{/if}

What will happen:

  1. Choose your new PDS
  2. Set up your account on the new server
  3. Your repository and blobs will be transferred
  4. Verify the migration via email
  5. Your identity will be updated to point to the new PDS
  6. Your account here will be deactivated
Before you proceed:
  • You need access to the email registered with this account
  • You will lose access to this account on this PDS
  • Make sure you trust the destination PDS
  • Large accounts may take several minutes to transfer
{:else if flow.state.step === 'target-pds'}

Choose Your New PDS

Enter the URL of the PDS you want to migrate to.

The server address of your new PDS (e.g., bsky.social, pds.example.com)

{#if flow.state.targetServerInfo}

Connected to PDS

Server: {flow.state.targetPdsUrl}
{#if flow.state.targetServerInfo.availableUserDomains.length > 0}
Available domains: {flow.state.targetServerInfo.availableUserDomains.join(', ')}
{/if}
Invite required: {flow.state.targetServerInfo.inviteCodeRequired ? 'Yes' : 'No'}
{#if flow.state.targetServerInfo.links?.termsOfService} Terms of Service {/if} {#if flow.state.targetServerInfo.links?.privacyPolicy} Privacy Policy {/if}
{/if}
{:else if flow.state.step === 'new-account'}

Set Up Your New Account

Configure your account details on the new PDS.

Migrating to: {flow.state.targetPdsUrl}
{#if flow.state.targetServerInfo && flow.state.targetServerInfo.availableUserDomains.length > 0 && !handleInput.includes('.')} {/if}

You can also use your own domain by entering the full handle (e.g., alice.mydomain.com)

flow.updateField('targetEmail', (e.target as HTMLInputElement).value)} required />
flow.updateField('targetPassword', (e.target as HTMLInputElement).value)} required minlength="8" />

At least 8 characters. This will be your password on the new PDS.

{#if flow.state.targetServerInfo?.inviteCodeRequired}
flow.updateField('inviteCode', (e.target as HTMLInputElement).value)} required />

Required by this PDS to create an account

{/if}
{:else if flow.state.step === 'review'}

Review Migration

Please confirm the details of your migration.

Current Handle: @{auth.session?.handle}
New Handle: @{flow.state.targetHandle}
DID: {auth.session?.did}
From PDS: {window.location.origin}
To PDS: {flow.state.targetPdsUrl}
New Email: {flow.state.targetEmail}
This action cannot be easily undone!

After migration completes, your account on this PDS will be deactivated. To return, you would need to migrate back from the new PDS.

{:else if flow.state.step === 'migrating'}

Migration in Progress

Please wait while your account is being transferred...

{flow.state.progress.repoExported ? '✓' : '○'} Export repository
{flow.state.progress.repoImported ? '✓' : '○'} Import repository to new PDS
{flow.state.progress.blobsMigrated === flow.state.progress.blobsTotal && flow.state.progress.blobsTotal > 0 ? '✓' : '○'} Migrate blobs ({flow.state.progress.blobsMigrated}/{flow.state.progress.blobsTotal})
{flow.state.progress.prefsMigrated ? '✓' : '○'} Migrate preferences
{#if flow.state.progress.blobsTotal > 0}
{/if}

{flow.state.progress.currentOperation}

{:else if flow.state.step === 'plc-token'}

Verify Migration

A verification code has been sent to your email ({auth.session?.email}).

This code confirms you have access to the account and authorizes updating your identity to point to the new PDS.

flow.updateField('plcToken', (e.target as HTMLInputElement).value)} disabled={loading} required />
{:else if flow.state.step === 'finalizing'}

Finalizing Migration

Please wait while we complete the migration...

{flow.state.progress.plcSigned ? '✓' : '○'} Sign identity update
{flow.state.progress.activated ? '✓' : '○'} Activate account on new PDS
{flow.state.progress.deactivated ? '✓' : '○'} Deactivate account here

{flow.state.progress.currentOperation}

{:else if flow.state.step === 'success'}

Migration Complete!

Your account has been successfully migrated to your new PDS.

Your new handle: @{flow.state.targetHandle}
New PDS: {flow.state.targetPdsUrl}
DID: {auth.session?.did}
{#if flow.state.progress.blobsFailed.length > 0}
Note: {flow.state.progress.blobsFailed.length} blobs could not be migrated. These may be images or other media that are no longer available.
{/if}

Next Steps

  1. Visit your new PDS at {flow.state.targetPdsUrl}
  2. Log in with your new credentials
  3. Your followers and following will continue to work

Logging out in a moment...

{:else if flow.state.step === 'error'}

Migration Error

An error occurred during migration.

{flow.state.error}
{/if}