A single crystal to single crystal transmetallation process takes place in the three-dimensional (3D) metal–organic framework (MOF) of formula MgII2{MgII4[CuII2(Me3mpba)2]3}⋅45 H2O (1; Me3mpba4−=N,N′-2,4,6-trimethyl-1,3-phenylenebis(oxamate)). After complete replacement of the MgII ions within the coordination network and those hosted in the channels by either CoII or NiII ions, 1 is transmetallated to yield two novel MOFs of formulae Co2II{CoII4[CuII2(Me3mpba)2]3}⋅56 H2O (2) and Ni2II{NiII4[CuII2(Me3mpba)2]3}⋅ 54 H2O (3). This unique postsynthetic metal substitution affords materials with higher structural stability leading to enhanced gas sorption and magnetic properties.