Migrating an instance from Mastodon

I am currently hosting a mastodon instance, but I would like to migrate to Akkoma, while retaining basically everything (followers, posts, likes, bookmarks, etc…).

Is this something even possible? That’s okay if I need to write code. I am currently the only user, so there are not so much data to migrate.

It’s been done before, but it’s not trivial. Afaik, you basically have to move and transform the data you have in your database to the structure of Akkoma’s database.

I have no idea how the data in Mastodon looks. In case of Akkoma, it closely follows Activity Streams 2.0 (the data representation that’s used to federate between servers). Activities (likes, announces…) are stored in the activities table. Actors (basically accounts/users) in the users table, and other objects in the objects table. Collections are generally stored as part of the objects they belong to.

Feel free to poke around and experiment, but know that it’s on your own risk. This is not a trivial thing, and may lead to data inconsistencies and problems in the future.

OK, thanks for the information. I will take a look.
I was also worried about how other federated instances might react, is there any problem to expect?

Ah, good point :thinking: Objects have an id which is an IRI, and the object needs to be fetchable through that. It’s possible you may need some redirects, but those should already be in the code (see https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/lib/pleroma/web/router.ex#L738). If not, you can still see if you can “translate” from one to the other at the level of your reverse proxy.

There are other IRI’s as well like inbox and follower collection, but at first glance, the format is the same on akkoma and mastodon, so shouldn’t give problems.

To give an example of what I mean; This is a simplified example of an object in Akkoma.

  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://ilja.space/objects/885a03c3-db2c-4d58-b1cf-6b74a1582907",
  "actor": "https://ilja.space/users/ilja",
  "to": "https://www.w3.org/ns/activitystreams#Public",
  "content": "Blablabla",
  "type": "Note"

You can fetch the actual object using it’s id with curl -L 'https://ilja.space/objects/885a03c3-db2c-4d58-b1cf-6b74a1582907' -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' (Note that there may be extra authentication requirements, but generally you should be able to fetch public posts and actors and stuff like this).

It also works with redirects. For example, if you would check this id in the browser, it will redirect to a different url. But if you try to fetch through that url, then that will also work because you follow redirects.

Basically, try it on a copy of your instance, see if you can still fetch everything that looks like an url correctly through that curl request, and if that works, it should be fine (but again, no promises, do it at your own risk, and all that :wink: ).

1 Like

Thank you so much!
I’m going to tinker with that. I’ll report back if I get any meaningful results.

1 Like