Single-crystal-to-single-crystal transformations of two three-dimensional coordination polymers through regioselective [2+2] photodimerization reactions.