Import existing connections
Move a Baileys or whatsmeow session to Polymorfa without pairing the phone again.
If a phone is already linked to Baileys or whatsmeow, you can move that linked device to Polymorfa instead of pairing again. The phone stays linked, and the Connection continues in your Polymorfa project.
Before you begin#
- A project and a credential with
connections:manageon your server. - A destination Connection reserved through QuickLink.
- Access to the source's authentication state: the Baileys
SignalStoreSnapshot, or the whatsmeow device store database.
In the Console, Connections → New connection → Import existing connections shows the same steps for each source.
Import a Baileys session#
Stop the source
Stop all writes to the Baileys authentication state, then take the
SignalStoreSnapshot.Request the handoff key
Call Get handoff keys for the destination Connection:
Shell curl -X POST "https://api.polymorfa.com/platform/connections/$CONNECTION_ID/handoff-keys" \ -H "Authorization: Bearer $POLYMORFA_KEY"The response contains
runnerPublicKeyB64, the Curve25519 public key to seal the snapshot to (base64url, no padding), andhandoffId, which you send back in the next step.Seal the snapshot
Seal the snapshot JSON to
runnerPublicKeyB64as a sealed box: the 32-byte ephemeral public key followed by the ciphertext, base64-encoded. Calculate the SHA-256 hash of the unsealed snapshot JSON as hex.Submit the sealed snapshot
Call Import handoff state:
Shell curl -X POST "https://api.polymorfa.com/platform/connections/$CONNECTION_ID/handoff-import" \ -H "Authorization: Bearer $POLYMORFA_KEY" \ -H "Content-Type: application/json" \ -d '{ "handoffId": "'"$HANDOFF_ID"'", "sealedEnvelopeB64": "'"$SEALED_ENVELOPE"'", "snapshotHashHex": "'"$SNAPSHOT_SHA256"'" }'Polymorfa verifies the hash after decrypting the snapshot.
Wait for the connection
Keep Baileys offline until the Connection reports
connection.connectedor its status isCONNECTED. Then resume traffic through Polymorfa.
Import a whatsmeow session#
whatsmeow sessions move through assisted migration. The Console does not accept raw database uploads.
- Keep the whatsmeow device store offline and its database unchanged.
- Export the device record and Signal tables from one consistent database snapshot.
- Send the snapshot through the assisted migration path.
- Keep the original store unchanged until Polymorfa confirms the imported Connection is connected.
Verify the import#
Read the Connection with Get connection, or watch for connection.connected on a webhook. Send a test message before you retire the source.