I ran into a couple snags while moving my Bluesky account to my self-hosted PDS. Wanted to gather these in one spot for future reference.
I followed @bnewbold.net’s guide for migrating with the goat tool. In no particular order, here are the fixes for each of the things I ran into.
Missing Blobs
goat account missing-blobs bafkreiemrwgk2gv2mue766kr6t4qh7mvvi75bz52muwsluef4kodhz6bji at://did:plc:v7tbr6qxk6xanxzn6hjmbk7o/app.bsky.feed.post/3jusenjs2oh2vBut the post is right here??? I deleted some other old hellthread posts trying to clean this up and struggled a bit.
I tried downloading the missing blob:
downloading blob to: bafkreiemrwgk2gv2mue766kr6t4qh7mvvi75bz52muwsluef4kodhz6bji
error: XRPC ERROR 400: InvalidRequest: Blob not foundSo expected blobs are 668 but there are 670? and why is this post visible but the blob is missing? at://did:plc:v7tbr6qxk6xanxzn6hjmbk7o/app.bsky.feed.post/3jusenjs2oh2v
ben@odin ~> goat account missing-blobs
bafkreiemrwgk2gv2mue766kr6t4qh7mvvi75bz52muwsluef4kodhz6bji at://did:plc:v7tbr6qxk6xanxzn6hjmbk7o/app.bsky.feed.post/3jusenjs2oh2v
ben@odin ~> goat account status
DID: did:plc:v7tbr6qxk6xanxzn6hjmbk7o
Host: https://shiitake.us-east.host.bsky.network
{
"activated": true,
"expectedBlobs": 668,
"importedBlobs": 670,
"indexedRecords": 22848,
"privateStateValues": 0,
"repoBlocks": 29047,
"repoCommit": "bafyreichzgkz2ugryxeg5ataukzstepgsghx3ckqn3vsvnwlsl72mk4wvm",
"repoRev": "3l7lc6zt3mm23",
"validDid": true
}
@genco.me helped me track this down a bit. The mentioned post above contains references to all blobs that were replied to for some reason. Not sure on the details for this one but posts in this era had full references of the entire reply tree instead of just parent and root.
I downloaded the missing one from the other user’s repo and reuploaded to mine. It seems to not think there are missing blobs now, but I’m still seeing 668 expected and 671 imported.
Import request too large
not sure where to track this down further error: failed importing repo: XRPC ERROR 413: failed to decode xrpc error message: invalid character ‘<‘ looking for beginning of value
[image or embed]— ben (@benharri.org) October 27, 2024 at 4:43 PM
This one was fixed by increasing the nginx client_max_body_size.
Importing Account Preferences
error: failed importing preferences: json: error calling MarshalJSON for type bsky.ActorDefs_Preferences_Elem: cannot marshal empty enumThis is because I had skyfeed prefs (app.bsky.actor.defs#skyfeedBuilderFeedsPref). The prefs json gets parsed and bails out here it if is an unknown schema actordefs.go#L222.
My workaround here was getting a copy of the prefs json without the tool (copy as curl from webtools) then I removed the skyfeed section. That wasn’t the complete fix either: the result from the browser wrapped the prefs in a json object and once I removed that, I was able to import to my new PDS.
That wasn’t all either: feedPrefs was mostly all moved to feedPrefsV2 so I deleted the old section and it seemed to import ok with that.
This prefs bug has been fixed in the goat tool in this PR, which removes the schema validation around the prefs json.
tl;dr the Actual Steps to do it
You won’t be able to keep your *.bsky.social username, so choose from username.newpds.example.com or your own domain. Check the official documentation or jump into account settings on the app to get handle change info.
Gather the following information and be prepared to replace it in the following commands where indicated.
- the new PDS host and invite code:
$NEWPDSHOST,$INVITECODE - desired new handle and credentials:
$NEWHANDLE,$NEWEMAIL,$NEWPASSWORD
Log in to your account with goat and request a PLC signing code. Don’t use an app password here. Place the password in single- or double-quotes if it contains special characters or spaces.
goat account login -u $OLDHANDLE -p $OLDPASSWORD
goat account plc request-tokenYou’ll receive the PLC token in your email. Grab it and set it aside.
With all the info ready to go, you can migrate your account like this:
goat account migrate \
--pds-host $NEWPDSHOST \
--invite-code $INVITECODE \
--plctoken $PLCTOKEN \ # from your inbox!
--new-handle $NEWHANDLE \
--new-email $NEWEMAIL \
--new-password $NEWPASSWORDIf all goes well, be sure to log out of your account everywhere before trying to use it again!
If you run into any trouble with this, check @bnewbold.net’s documentation.
Leave a Reply