The why and how of backing up your Mastodon data

By | January 2, 2026

Why this matters

Recently, the admin of a relatively prominent Mastodon¹ server, med-mastodon.com, decided to stop maintaining the server and shut it down without warning. This is, generally speaking, a terrible thing to do, but I will give the admin the benefit of the doubt and assume that he had some very good reason why he needed to shutdown without giving his users time to export their data or migrate their account to a new server (though as far as I’ve seen he hasn’t shared any such explanation).

Unfortunately, this isn’t the first time this has happened, and it won’t be the last. Even servers whose admins have agreed to follow the Mastodon Server Covenant, which among other things requires server admins to commit to giving users at least 3 months’ warning before shutting down, occasionally go belly-up without warning.

This could happen to your server at any time. Your server admins may be great people, but shit happens. Not only that, but your server’s admins or moderators could decide at any time to suspend or delete your account.

Some people protect themselves from this by self-hosting their own server. That has advantages, but it also has disadvantages, including time and money costs, and so it’s not for everyone. If you’re not interested in self-hosting, but you also don’t want to run the risk of suddenly losing all your Mastodon data, then you should be backing up your data on a regular basis.

How to back stuff up

The most important thing to back up is the list of who you follow; fortunately that’s also the easiest. In the Mastodon web app, go to Preferences, then click “Import and Export” on the left, and click “CSV” to the right of “Follows”.

There you can also download your lists, muted and blocked people and domains, and bookmarks. All of those can be imported into a different Mastodon server using the “Import” page linked on the left.
Set up a reminder to back up this stuff regularly!

The next thing to back up is posts and uploads. If you consider social media transient, you may not care about this, but otherwise, you can periodically click the “Request your archive” button on the export page. You’ll receive a notification when the archive is ready to download.

Note that unlike the CSV files, your posts and media are not easy to upload into a new server. Unless you want to jump through some hoops (see below), you’re just downloading them for reference.

If you’re paying attention, you may have noticed that there’s something important missing above: what about your followers? Can those be backed up? Alas, it’s not easy.

The way it’s supposed to work is when you decide you want to migrate to a new account, you configure your old account to tell your followers automatically what your new account is, and their accounts follow your new account automatically. But obviously, that doesn’t work if your old server goes away with no notice!

I’m not aware of any web tools for backing up your followers (if you know of any, post a reply!), so if this is something you care about, you’re going to need to resort to the command line. Command-line tools that support exporting followers from your server include:

If you’re so inclined, you could also write code to do the export yourself; Mastodon has a rich, well-documented API.

Note that mastodon-archive also supports backing up a bunch of other stuff, so you could use it to set up periodic automated backups of all the data listed above, rather than just followers. Personally, I have mastodon-archive backing up my data automatically every night.

The toot utility mentioned above also supports downloading followed hashtags (“toot tags followed“), which you may also want to back up if following hashtags is a significant part of how you use the fediverse.

But what about all my filters?

(Hat tip to Royce Williams for reminding me here that I forgot to cover filters in the first published version of this article.)

If you use a lot of filters to optimize your Mastodon experience, then losing your filters when your account goes away could be painful, so you probably want to back them up as well.

Unfortunately, there is no way to export or import filters from the Mastodon user interface, and there also doesn’t appear to be any pre-baked command-line tool available to do the job. However, I’ve got you covered, if you know how to use a Python script:

https://gist.github.com/jikamens/6ffc52a7f85439046c32e05c7a67a906

What to do with the backed-up data

You pretty much can’t import your old posts

The bad news first: there is no good way to migrate your posts from one server to another. This isn’t just true if the old server goes away; there’s also no good way to copy posts from an existing server to a new one. People have been asking for this for many years but apparently it has not been enough of a priority for the Mastodon developers to implement it.

There’s at least one early-stage effort to build this functionality, and somebody has written a clever tool that server admins can use to do it as long as the old account is still available, but neither of these is a robust general-purpose solution.

You can still browse your exported data, look at the posts in a text editor, write your own code to do stuff with the data, etc. Furthermore. There are a number of tools for viewing and searching through your exported post archive.

How to get your followers back

If your account wasn’t migrated automatically because it disappeared out from under you, then assuming you’ve archived your followers as described above, you’re going to need to reach out to them one by one, let them know what your new account is, and ask them to follow you again.

(If you’re in online fediverse communities where people know you, you can also make a public post about your new account and ask people you know in those communities to boost it. You may need to do this several times to catch everybody, and you might still miss some people.)

If you have a lot of followers, then sending a bunch of DMs one by one to all of them will probably be a drag. You could automate it with toot, but be careful of running afoul of your server’s posting limits; you may get throttled if you post too many DMs too quickly.

Also, keep in mind that some people don’t read DMs at all, or don’t read DMs from people they don’t follow, so everyone may not see your messages asking for them to follow you again.

Restoring followed hashtags

You can use the toot utility (“toot tags follow hashtag“) to restore the followed hashtags from the list you previously exported with toot. Or if there aren’t too many you can just search for them by hand in the web app and then follow them.

Everything else, you can import

The import page in the web app’s preferences can be used to import the CSVs exported from the export page. If you used mastodon-archive or toot or whatever to export the data instead, then you can manually construct a CSV in the correct format for import.


¹This article focuses on Mastodon for clarity, but much of what is written here is applicable to any type of fediverse server.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *