How to run a copy of a live mastodon instance, prior to migration

I’m migrating an existing mastodon instance to a new server. It’s docker based, matodon v2.5.0.

The existing instance was:

  • somewhat customised, using docker swarm not docker-compose
  • has a significant number of users
  • is essentially abandoned by its original admins, and the setup is undocumented

So I’m learning all the details on the job, not previously having installed mastodon, being a mastodon admin, nor even very familiar with docker.

Most people, as I understand it, migrate by getting the new server working following the vanilla instructions and a blank database, then migrating the database during a single block of downtime.

What I’d like to be able to do is run the new instance on a temporary domain with a snapshot of the existing instance’s database, to verify I’ve got it all working before I switch off the old one and transfer the domain.

But, I’m led to understand I may create some sort of federation “mess” if I do that naively. So:

  • what can I do to avoid that?
  • how would I clean up the mess if I did manage to slip up?

Can you be specific about what kind of mess you need to clean up? Moving instance to other address will not work as expected.

Thanks for replying. Thankfully I don’t have any federation mess to clean up. Not yet, anyway! The migration hasn’t yet been done for real.

I’d prefer to do a test run of the migration, as close to the real case as possible. I think this may amount to disabling federation (with a firewall? configuration? code?) and faking the hostname with /etc/hosts, but disabling federation seems to be something no-one can explain how to do. My attempts to firewall the instance run into problems with docker and various other parts of the deploy process requiring network access to operate, I suspect they’re fixable with the right whitelist, but advice would be very welcome.

I think I know what you would like to achieve but I am afraid it is easier to let it run live and fix problems as they go… I wish there was a series of “smoke tests” to determine health of the instance.

I also think it is hard to really test federated integration in isolation…

That is the message I’m getting…

It does seem, well… strange, that there is no way to disable federation, which would be a start. After all, a lot of the support questions I see are variations of “haelp! my federation isn’t working.”