gotosocial icon indicating copy to clipboard operation
gotosocial copied to clipboard

[feature] Account `move` activity for instance migration

Open tsmethurst opened this issue 3 years ago • 12 comments

Mastodon allows an account to migrate from one instance to another, as documented here:

https://docs.joinmastodon.org/user/moving/#migration

Under the hood, this uses a combination of the activitypub move activity, and the alsoKnownAs field on profiles, as documented here:

https://docs.joinmastodon.org/spec/activitypub/#profile

It would be very cool if GoToSocial was able to support this as well, to allow accounts to move freely across instances with different AP implementations and features.

In order to do this, we need to first add alsoKnownAs to the library that GoToSocial uses for federation: https://github.com/go-fed/activity -- using astool: https://github.com/go-fed/activity/tree/master/astool. Then, either we make a PR against that repo (preferred), or we fork the repo and use our own fork (much less preferred, and silly).

Once that's done, we need to implement some functionality in GtS for setting alsoKnownAs -- probably through a PATCH to the /api/v1/accounts/update_credentials path (https://github.com/superseriousbusiness/gotosocial/blob/main/internal/api/client/account/accountupdate.go). This PATCH would update this field in the account model: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/gtsmodel/account.go#L112

Finally, we'd need to implement the move activity in the federating database -- https://github.com/superseriousbusiness/gotosocial/tree/main/internal/federation/federatingdb -- and process side effects in the processor somewhere -- https://github.com/superseriousbusiness/gotosocial/blob/main/internal/processing/fromfederator.go

tsmethurst avatar Aug 03 '21 10:08 tsmethurst

Hi, i want to migrate my acc to a gts instance, but i am currently blocked by the lack of alsoKnownAs. Am i correct to assume that one can look up the json-ld schema to feed into astool here?

https://github.com/w3c/activitystreams/commit/54a6723ed1c8b95a12997b4e73100308e267fc8f

Also, activity lib looks unmaintained atm.

Houkime avatar Nov 01 '22 18:11 Houkime

I'd be very interesting in helping out with this!

natemoo-re avatar Dec 06 '22 19:12 natemoo-re

I'd be very interesting in helping out with this!

Noted, thank you :) it'll be a while, bunch of other stuff to do first

tsmethurst avatar Dec 07 '22 09:12 tsmethurst

@tsmethurst Saw you just assigned this one to yourself. Let me know if you need any help, happy to help however I can!

blakesmith avatar Dec 17 '23 05:12 blakesmith

Thanks for the offer :) I'll be picking this up after our Christmas break (so, start of January).

tsmethurst avatar Dec 18 '23 14:12 tsmethurst

Also, activity lib looks unmaintained atm.

@Houkime We maintain a fork here: https://github.com/superseriousbusiness/activity

tsmethurst avatar Dec 18 '23 14:12 tsmethurst

Just created my gts instance so, I'll be testing the migration from my masondon instance as soon as it's ready.

mkarliner avatar Jan 08 '24 18:01 mkarliner

Moving this back to the 0.15.0 milestone as there's quite a lot of complicated moving parts to get this right, and we decided we'd rather take plenty of time to ensure it works properly instead of putting it in a release too soon without sufficient testing. It's a v. high stakes feature, as a botched Move could mean that you lose your relationships with followers/following, so it's crucial we test this sufficiently, because we don't people to mess up their accounts. You'll have to hold your horses a little longer! :hand: :horse:

tsmethurst avatar Feb 17 '24 14:02 tsmethurst

@tsmethurst Thanks for your care and thoughtfulness! Definitely a feature you want to get right. Appreciate all you do!

blakesmith avatar Feb 17 '24 15:02 blakesmith

Thanks, that's sweet :)

tsmethurst avatar Feb 17 '24 16:02 tsmethurst

Moving your account is now implemented on main. Currently only followers are moved, other things like following, blocks, etc, are not. We'll add some endpoints for import/export of such things as we go along. Once Move is in a release, I'll close this issue :)

tsmethurst avatar Mar 13 '24 14:03 tsmethurst

These are great news 👏

~~I'm sorry if that has been already answered before, but does this include moving from GoToSocial (e.g. to Mastodon), or moving to GoToSocial (e.g. from Mastodon)? Maybe both?~~ As seen from pull requests - both 👍

gytisrepecka avatar Mar 13 '24 14:03 gytisrepecka