This tip is so specific that I’m surprised that it has come up as frequently as it has. For context, many people use Klipper on a Raspberry Pi to manage their 3d printer. There are two main interfaces for Klipper, Mainsail and Fluidd. This tip is for those who are set up with Mainsail.
When moving your 3d printer to a new wifi network, there are two things that I do. With the Raspberry Pi powered off, remove the SD card and put it into your laptop or desktop computer. Ensure that you don’t use Notepad or Wordpad to edit the file, as they tend to bring in characters that mess up files. Use something like Notepad++ instead. In the root directory of the SD card you will find a file called mainsailos-wpa-supplicant.txt. Open that file in your text editor and change your network information. Most common nowadays is WPA/WPA2.
The other optional step that I do is to log into the router and set up my Raspberry Pi as a static ip address instead of letting DNS manage it. Each router is different, so I won’t go into detail on how to do that here. Most routers have something like “Advanced networking.”