The copper fluoride Cu2F5 is a compound with two-dimensional (2D) magnetic exchange interactions between the Cu ions in the S=1 and S=12 spin states. Using ab initio calculations, we predict that the existence of 5% vacancies in the fluoride sublattice of Cu2F5 results in a drastic transformation of the spin state of all copper ions and the final spin states are S=12 and S=0. Consequently, the anisotropy of the magnetic interactions increases, and 1D linear chains of Cu d9, S=12 ions appear. We also propose a microscopic mechanism of such a transformation of the exchange interaction via CuO6 octahedra elongation. © 2023 American Physical Society.