Yes but Lees move was ill-fated to say the least. He not only lost at Gettysburg but the very next day, July 4, 1863 Vicksburg fell after Grants month-long siege of it. This geographically split the Confederacy in two and gave the North control of the vital Mississippi River and forced Davis to move to the capitol to Richmond. And for some eighty odd years afterward the city of Vicksburg didn’t celebrate The Fourth Of July.
The capital of the CSA was moved from Montgomery, Alabama to Richmond in May, 1861.