I switched residencies after PGY3 and had to find a PGY4 position because we were in Connecticut but my husband was about to start his Electrophysiology fellowship in Houston. I did it by discussing it with my current program director (making sure he was not going to shaft me in reco's because he WAS displeased) and explaining the situation in lots of letters to programs local to Houston.
You have to do a great deal of communication, avoid ruffling feathers, and make sure you have good (ie, not histrionic or whiny) reasons to present as to why you wish to switch programs.