I seem to recall that there may be tools out there to help this, but your googling will turn up whatever that was just as quick as mine.
I would say that I tried doing this myself, twice, and by the second time I decided to handle it manually. That is, I downloaded and saved (I know, I should have done better saving the originals) the various graphics my site used, as well as my list of contacts, etc., and then re-uploaded them to the new location, then relinked them from within Mastodon. The first time the migration didn't work, there was no one who could help, and it was just quicker to do it manually. All the graphics connected to other users were eventually repopulated anyway, and anything I had wanted previously I had downloaded and saved. So, in a way, there wasn't a need to migrate anything. Good luck.