I have been researching this after what I thought was a truth (through a series of elections and bills, ideologies shifted), but then I saw a video by that hack D'Souza that said it is all perpetrated by the Democratic Party.
I found a great site (http://factmyth.com/factoids/democrats-and-republicans-switched-platforms/) that goes pretty in depth, but even people in the comments there are attacking that dude.
HALP!
https://m.reddit.com/r/AskHistorians/wiki/us_history#wiki_changing_role_of_republicans_and_democrats
You can find a list of previous responses to this question with the link above. The wiki has a great collection of FAQs.