New Hofmann-type metal–organic frameworks display rare and complete ligand exchange induced single crystal to single crystal transformations from 3D frameworks to 2D layers, accompanied by magnetic properties transition from two-step SCO behavior to hysteretic SCO behavior.