My original Mastodon account was on mastodon.social. I picked it because it’s the biggest instance, it’s run by the designers of the service, and it runs the referral implementation of the software application. I wished to experience the fediverse, initially, as the majority of people do, then think about whether to move to another server, and if so, which one.Last week
I migrated to social.coop which, like cosocial.ca, is what Darius Kazemi calls a community-owned independent social media website. I do not think the acronym COISMS will fly, however business model is simply what I have actually been looking for. I do not wish to use “free” services that make me the item they sell. I wish to pay for a service that’s funded by my dollars, not by my information. That’s why I bailed on Gmail years back, in favor of Fastmail, and it’s why I more than happy to invest $10/month– the cost of a number of cappucinos– to support individuals who keep the lights on at social.coop and maintain civility.The guidelines for moving from one server deal two courses: Profile redirect and Profile move. I picked the previous, since I assumed I would keep API access to mastodon.social post-migration, and thus have the option to utilize Steampipe to query both accounts. Why do that? You can’t migrate your posts from the old server to the brand-new one, only your fans and(optionally) your follows, bookmarks, blocks, and mutes. Steampipe can link to 2 different Mastodon servers at the same time, so I figured I could run inquiries versus both.Lessons found out That ended up being a wrong assumption. I can reactivate my mastodon.social account by shutting off the redirection
, however I’m unclear on the ramifications of doing that. On the other hand it’s still possible to export my posts, so I can constantly reacquire them that method if needed.Here was another incorrect assumption. I believe that if I ‘d chosen to move my account, rather of redirect it, my profile would have transferred to the brand-new server. Rather it was on me to complete the new profile. I ‘d developed @judell @social. coop however, when I started the migration, I hadn’t yet finished the profile. So when followers were alerted that [email protected] was now following them, there was no photo or bio or verified website. That led some people to think it was a bogus account and obstruct it. It wasn’t a disaster, and I have actually talked with a few of them to fix the matter, however it was an unforced mistake that would have been easy to avoid.The view from here Here’s a comparison of weekly activity on 2 servers, by method of the server dashboard. IDG What’s it like moving to a server with only 1%of the flow that happens on mastodon.social? Not too various! Due to the fact that I’ve moved my fans and follows, and because I communicate primarily with the house timeline and with lists, the experience is primarily the very same. For instance, here’s the chart of boost relationships amongst servers in my house timeline. It looks similar to it did previously. IDG It’s fantastic to have a portable social chart that you can bring along as you move around in the fediverse . The crucial distinctions are that I’m fulfilling brand-new individuals, and spending more time on the local timeline.
huge server like mastodon.social the local timeline feels like the Twitter firehose, for those who remember when that was still a thing you could enjoy. I ‘d take a look at it sometimes, because it could be a source of beneficial serendipity, but primarily it was just too random. The regional timeline on social.coop is still rather random, however I find it more useful– not only due to the fact that it represents a far smaller population however also since the people who’ve registered share a typical interest in the cage model. I want my lists There was, however, one big obstacle. You can export lists from the old server and import them into the new server, however there’s no export/import for the accounts you have actually assigned to those lists. Given that I rely heavily on lists to navigate Mastodon flow in a focused and deliberate method, this was a problem I truly required to repair. I tried Eliot Nash’s masto-list-importer but when I tried to move my 460 person/list mappings I hit API rate limits. So rather I exercised a Steampipe-based solution which is an useful option, and likewise a good way to highlight the actions involved.Let’s assume that I want to migrate once again, from social.coop to fosstodon.org. I have actually exported the names of my lists from social.coop, and imported them to fosstodon.org. Now I require to populate those lists. The SQL option I came up with earnings by actions, each being a common table expression (CTE)that achieves one part of an intricate improvement, then passes results to the next step.Step 1: Collect the accounts assigned to each social.coop list.We start by signing up with 2 tables to enumerate accounts designated to each list. with accounts_by_list as(choose a.acct as old_account, a.id as old_account_id, l.id as old_list_id, l.title as title from social_coop. mastodon_my_list l sign up with social_coop. mastodon_list_account a on l.id =a.list _ id )select * from accounts_by_list The output, in accounts_by_list, is successfully a momentary table that you can examine to make sure the outcomes are as expected.
The ability to verify the output of each stage of a CTE pipeline, prior to sending it to the next stage, is a key benefit of this technique. Embedded subqueries are much more difficult to debug! Step 2: Map the accounts on social.coop to accounts on fosstodon.org 2 improvements happen in this stage. If an account is a bare username, say personality, then it’s a social.coop account. On fosstodon.org that very same account will be represented as [email protected]. Alternatively if [email protected] exists on social.coop, that account becomes the bare username personB there. All other accounts(e.g. [email protected]) travel through unchanged.with accounts_by_list as(– as above), adjusted_accounts_by_list as (choose old_account, old_account_id, old_list_id, title, case when old_account! ~’@ ‘then old_account
| |’@social. coop’ when old_account ~’ @fosstodon. org ‘then replace (old_account,’@fosstodon. org ‘,”) else old_account end as new_account from accounts_by_list )choose * from adjusted_accounts_by_list Step 3: Map the list titles to the new server.The names of the lists are the exact same in both locations, however their ids differ. For example, my Fediverse list
is 1043 on social.coop and 6771 on fosstodon.org. To invoke the API call that includes somebody to a list, we’ll need to use the latter id.with accounts_by_list as(– as above), adjusted_accounts_by_list as(– as above), adjusted_list_ids as(choose a. *, l.id as new_list_id from adjusted_accounts_by_list a sign up with fosstodon.mastodon _ my_list l on a.title=l.title) select * from adjusted_list_ids Step 4: Map the account ids to the brand-new server.Like lists, accounts on the new server also have various ids, and those are also needed for the API call. We can find the new ids by signing up with the new_account column from action one with the table fosstodon.mastodon _ my_following. with accounts_by_list as (– as above ), adjusted_accounts_by_list as (– as above), adjusted_list_ids as(– as above,), adjusted_account_ids as( select a. *, f.id as new_account_id from adjusted_list_ids a join fosstodon.mastodon _ my_following f on f.acct=a.new _ account) choose * from adjusted_account_ids Step 5: Develop the API calls There are lots of methods to skin this feline. Because you can use Steampipe as an element, you could use any
programs language with a Postgres chauffeur to run this inquiry, and call the Mastodon API with the suitable list and account ids. And then, obviously, there’s always curl.with accounts_by_list as(– as above), adjusted_accounts_by_list as (– as above ), adjusted_list_ids as (– as above ), adjusted_account_ids as (– as above )choose’curl-X POST-H “Authorization: Bearer ***” https://fosstodon.org/api/v1/lists/’|| new_list_id||’/ accounts/?’| |’account_ids =’
||new_account_id|| ‘; sleep 1;’as command To avoid throttling, I added sleep 1 to each line. I saved the query in migrate-lists. sql, and exported the output to a file.steampipe query– output csv migrate-lists. sql > migrate.sh That was close, however not rather best. The output looked like this: command”curl-X POST-
H”” Authorization: Bearer ***” “https://fosstodon.org/api/v1/lists/6771/accounts/?account_ids = 279462; sleep 1;” “curl-X POST -H “” Authorization: Bearer ***””https://fosstodon.org/api/v1/lists/6771/accounts/?account_ids =109283421559929728; sleep 1;”I require to get rid of the header line, get rid of the double quotes on either end of each line, and deduplicate the pairs of double quotes. For that I turned to ChatGPT(v4). It took a few tries to get it right, but quickly enough it produced a working bash script that I’m very happy I did not need to compose. #!/ bin/bash # read the original script from migrate.sh and store it in an array readarray-t original_script