Why did Ronald Reagan switch from being a Democrat to a Republican in 1962?

Ok so let me preface this with this is my first time posting here and I am a little unsure of what all will require sources bit I will do my best. Ok first to understand what Regan was a democrat in the first place we need to go back to the civil war, Abe Lincoln was the first Republican president and part of his party's platform was not spreading the slave trade into the new states( Cauthen, Charles Edward; Power, J. Tracy.South Carolina goes to war, 1860-1865.Columbia, SC: University of South Carolina Press, 2005. Originally published: Chapel Hill, NC: University of North Carolina Press, 1950) this is why sc succeeded because they felt slavery was being threatened by the new president . flash forward to after the civil war and during radical republican reconstruction the south was under a close watch of the federal government and had to submit to letting former slaves have more rights, and not allowing anyone from the Confederacy run for office ( Behrend, Justin. Reconstructing Democracy: Grassroots Black Politics in the Deep South after the Civil War (University of Georgia Press, 2015), 355 pp) Radical reconstruction ended through a compromise that allowed Hays to become president and the south to not have to answer to the federal government as much. With reconstruction over the south started voteing democrat because the democrats at the time agreed with Jim Crow laws and other ideas that kept the south's blacks as second class citizens. Until the late 1940s when the party split about what to do in regards to segregation and other civil rights issues . part of the party became the dixicrats (Lemmon, Sarah McCulloh. "Ideology of the 'Dixiecrat Movement," Social Forces Vol. 30, No. 2 (Dec., 1951), pp. 162-171 in JSTOR) slowly the Republican party changed its platform to pick up the southern voters who no longer saw themselves as democrats it was these changes in party ideas that leas to Regan's scotch.( Rutland, Robert Allen. The Republicans: From Lincoln to Bush (1996)

/r/AskHistorians Thread