How to upgrade an instance to Mastodon 4.2
The Mastodon documentation contains an excellent overview of the upgrade process. Based on that, you can come up with the list of commands necessary to carry out an upgrade.
Don't forget to back-up