A bunch of people online have stated the shift existed long before Nixon's southern strategy; however, my APUSH teacher taught us that Nixon's dog whistle politics was the main reason the switch happened.
I think that this whole party switch idea is one that is overstated and misunderstood. If you read Caro's LBJ biographies you see a description of the parties that is very complex in the middle to early part of the 20th century and how regional and national politics were sometimes discrete.
I think with the Grant presidency you see a Republican Party that has a lot of social progressive qualities but that really believes that if business does well then everyone will do well. Indeed I think that one of the more consistent aspects of both parties is how they see what needs to happen in order to produce wealth and prosperity for everyone.
Republicans seem to lean towards policies that rely heavily on the idea that when there is strong growth for business that it will translate to more jobs and higher salaries. Democrats seem to see worker empowerment being the fastest route to a more universal prosperity. That's not to say that the GOP hasn't done things for workers rights and that the Democrats haven't done things to help business interests; it just seems thematic for the parties to be so aligned.
If you look at Chernow's biography of Grant you can see the character of the Republican Party come start to coalesce. The Grant administration leaned heavily on the private sector for cabinet positions and policy ideas. The results were by and large positive and despite some of the popular notions to the contrary Grant did a good job expanding the countries economic power while championing policies that were also socially ahead of their time.
Jump ahead to the end of the 19th century and go through and read some of McKinley's and William Jenning Bryan's speeches and you see how much the characters of both parties had come very close to what we understand today.
The oft quoted Cross of Gold speech by Bryan contains a passage that would have appealed to Democrats of any era...
Mr. Carlisle said in 1878 that this was a struggle between the idle holders of idle capital and the struggling masses who produce the wealth and pay the taxes of the country; and my friends, it is simply a question that we shall decide upon which side shall the Democratic Party fight. Upon the side of the idle holders of idle capital, or upon the side of the struggling masses? That is the question that the party must answer first; and then it must be answered by each individual hereafter. The sympathies of the Democratic Party, as described by the platform, are on the side of the struggling masses, who have ever been the foundation of the Democratic Party.
There are two ideas of government. There are those who believe that if you just legislate to make the well-to-do prosperous, that their prosperity will leak through on those below. The Democratic idea has been that if you legislate to make the masses prosperous their prosperity will find its way up and through every class that rests upon it.
Karl Rove even wrote a book about McKinley and his campaign against Bryan in 1896. In a discussion of that book in the New York Times they refer to an account of his campaign that shows a very interesting and strangely contemporary aspect of the McKinley effort.
With the strategic counsel of Mark Hanna and Charles Dawes, his leading advisers, McKinley advanced a platform for the protection of industry with high tariffs and for the defense of a gold-backed dollar against the free-trade, silver currency platform of Bryan and the Democrats. Rather than exhaust himself as Bryan did, by frantic barnstorming and lengthy speechmaking, McKinley ran a campaign that was “almost industrial in scale.” Some 750,000 persons, organized in handpicked clusters of occupational, ethnic and regional blocs, were brought to McKinley’s front porch in Canton, Ohio. There, the candidate offered concise, tightly crafted speeches tailored to each specific group. These, in turn, were spread to larger audiences both by the publicity provided by the relatively new mass press and by an unprecedented public relations effort.
Reading Caro's accounts of LBJ running for office in Texas and later, his efforts to manage the Democratic Caucus in the Senate there is definitely aspects of the Democratic Party in Texas that would seem more like what we would expect to be Republican. John Nance Garner, Cactus Jack, who was FDR's first Vice President and the former Democratic Speaker of the House was definitely a conservative. But that by no means was a consistent definition for Texas Democrats. If you look at fellow Texan and former Speaker of the House Sam Rayburn you have an FDR Democrat in much the way LBJ was when he served in the House. But the Southern Conservative Democrat was an institution but what held them in the Democratic Party was that kind of working class audacity that seems to have migrated to the Republican Party after the decline of the Union Movement in the Reagan years. The Democratic Party was still the home of populism and institutional racism to some extent. But as the Union Movement became more integrated and concerned with social justice reforms so too did the Democratic Party.
Nixon's southern strategy was really a culmination of a move from Democratic Party to Republican of certain disaffected white Americans. But it was generations in the making. But that doesn't mean that the bedrock of the Republican Party wasn't the same in 68 as it was in 1896. There was simply a shift in the coalition of certain groups of America. Strom Thurmond's switch to the Republican Party saw that aspect of the Democratic Party move over to the Republican and was where it solidified. But I think that the overarching themes have been there and that the only real difference is how the parties have used wedge issues to forge new and different alliances.
There was a time when evolution was a hammer that Democrats used on Republicans for instance. The aforementioned Bryan was one of the fixtures in that socio-political set piece. But at the time Darwin's theory was being used to explain away poverty as the inability for certain people to compete and therefore they might not be among the fit that will survive. The social Darwinism was used in a way not unlike how current conservative thinkers use Objectivism and the theories of Ayn Rand.
So essentially while aspects of the parties that are very visible have changed and recombined the values inherent in the parties around wealth and prosperity have been fairly consistent. I think that the way people understand parties in the US could likely help clarify this as well. The parties are really all coalitions of other social movements, not unlike minor parties in Parliamentary Systems, and come together to form a coalition that is the Democratic and Republican Parties. So while the Civil Rights movement moved to the Democratic Party and the Christian fundamentalists moved to the Republican at their core; the struggle between businesses and labor unions seems to really form the ideological basis of both parties going back for a pretty long time.