The Data Transfer Project was launched in 2018 to create an open-source, service-to-service data portability platform so that all individuals across the web could easily move their data between online service providers whenever they want.
What’s interesting is that there is already support for Mastodon, so for instance one one can get their data from Facebook and transfer it to Mastodon: