splitbrain.org

electronic brain surgery since 2001

Mastodon to GoToSocial Migration

GoToSocial

My Mastodon instance is closing down in April, so I had to move to a new instance. And picking instances is hard, so why not run my own?

Instead of running a full Mastodon instance I decided to run the much leaner GoToSocial (GTS). Here's how I set it up and migrated my data.

GoToSocial Setup

I am running GTS in my Docker compose setup. Their installation guide contains all I needed to get it running.

My docker-compose.yaml is on Github.

Once the container is initialized and has created it's sqlite database, it's a good idea to back up the volume, in case you want to restart from zero.

cp -r volumes/gotosocial volumes/gotosocial.empty
During setup the identity of the instance is created and bound to the used (sub-)domain. As soon as the server interacts with the Fediverse, the domain should never ever change it's identity or you will run into trouble. So if you need to start over, better do it with the same identity, thus the backup.

Next I created my user and promoted it to admin:

docker compose exec fedi ./gotosocial admin account create --username splitbrain --email andi@splitbrain.org --password 'initialsecret'
docker compose exec fedi ./gotosocial admin account promote --username splitbrain

Since you have to provide the password on the command line and I didn't want it to end up in the shell history, I set a dummy password.

You then can access your new instance via the web, login and go to SettingsEmail & Password and set a new password.

While I were there I also set up some account basics, like an avatar image and a short bio.

When importing stuff later, people might get follow requests so it helps if they know who you are. I explicitly mentioned my old account in the bio.

I also disabled the “Manually approve follow requests” option to ease migration.

Import your Mastodon Posts

I did not want to start with an empty account. So I spent quite some time to write my own importer. Only to discover the much better slurp project a couple of weeks later. Luckily I had procrastinated the “real” migration.

The first step is to export your Mastodon data. In your old instance go to PreferencesImport & ExportRequest your Archive.

Wait for the email link, download the zip and extract it. Note that it does not have a top level directory:

mkdir archive
cd archive
unzip ../archive-*.zip

Next we need to install and compile slurp. You need go for that so install it via your package manager.

Note: you can do all this on your local computer. Slurp speaks via the API to GoToSocial
git clone https://github.com/VyrCossont/slurp.git
cd slurp/
go mod download
go build .

With slurp ready to go, first log into your old and new instance.

# old instance
./slurp --user splitbrain@octodon.social auth login
# new instance
./slurp --user splitbrain@fedi.splitbrain.org auth login

The above will trigger the oauth workflow in your default browser and waits for you to paste the auth token.

You can import the custom emojis from your old instance to the new one. However my old instance had a fuckton of emojis and I maybe only ever used a handful. So I decided to not import them. Instead I will use the –allow-missing-custom-emojis to simply not use any graphical emojis for those toots.

Time to import all1) your old posts. This will take a while:

./slurp --user splitbrain@fedi.splitbrain.org archive import --file ../archive --status-map-file ../archive/status-map.json --attachment-map-file ../archive/attachment-map.json --allow-missing-custom-emojis

The map files mentioned in the command do not exist prior to the import. They are used to keep the state 2).

Use a Client to Verify

Time to check if everything imported correctly. GoToSocial does not have a UI - instead you need to use a Mastodon compatible client. I use Tusky on my phone and Masto-FE in the browser3).

Doing the Move

If everything looks good, it's time to start the actual migration. The GTS Migration Guide explains it well.

First we need to make the new account an alias of the old one.

In the GTS Settings, go to Migration and add the URL to your old account as an alias:

https://octodon.social/@splitbrain

Now on the old instance, it's time to initialize the move. Go to PreferencesAccountMove to a different accountconfigure it here.

Enter the new account (splitbrain@fedi.splitbrain.org) and confirm with the old instance's password.

Your old instance will now start pushing your followers to the new instance. This will take a while. Users might need to confirm the move on their side. The follower number on your new instance should rise and the follower number on the old one will decrease.

You can also still post to the old instance, letting your followers actively know that you moved.

Migrate more Data

The last important piece of data you're still missing at that point is the accounts you follow (and block).

First download them from the old instance in PreferencesImport and exportExport. Download the CSVs for “Follows” and “You Block”.

In the new instance go to SettingsExport & Import. Pick the correct CSV file and the type. The import mode doesn't matter since there's nothing to overwrite yet.

Bookmarks seem not to have an UI to import in GoToSocial. But we can use slurp again to export them from the old instance and into the new one.

./slurp --user splitbrain@octodon.social bookmarks export >bookmarks.list
./slurp --user splitbrain@fedi.splitbrain.org bookmarks import -f bookmarks.list

You can use the same approach for filters and mutes. I didn't have anything worth of importing here, so I skipped that.

Done

That's all. The GoToSocial project said that they want to integrate the functionality of slurp right into their software, making the whole process much easier in the future. I think that's an excellent idea.

Thoughts and Next Steps

Running a single-user instance is a bit different than being on a popular instance. Following hashtags will do basically nothing, because your server will rarely see a hashtagged post that isn't in your timeline anyway.

Missing replies to posts other than your own is an issue even on big instances and the problem is more pronounced on a small setup. I experimented a bit with FediFetcher to fetch missing posts but it always felt like it was pulling too much. I don't need the whole fediverse mirrored to my instance.

TBH. I feel its mostly fine. I see replies from people I care about. And if there's a topic I really want to see more replies to, I can always visit the originating server.

For the hashtag issue, I think there are bots you can follow that repost a given hashtag. I haven't really looked into it.

Currently I keep all media local. But I might run into space problems at some point. I might get some cheap S3 compatible storage then and migrate the media to S3.

GoToSocial has a shared blocklist feature. I haven't set up anything yet. But the Garden Fence block list seems like a good start. Not that I had any issues with spam and abuse yet.

So far I am happy with the setup. It seems to run fine and I am missing no important feature.

Tags:
fediverse, mastodon, gotosocial
1)
Actually, not all. Just the ones that do not interact with other users. Read the slurp README for more info
2)
and theoretically allow you to interrupt and continue the import, but I did not try that
3)
I might add my own instance of that to my docker compose setup later