After the Civil War, the economic recovery of the southern United States hinged on trade with the North and moving goods westward via the railroad. But there was a problem. Tracks in the South had been built with a gauge (or track width) of 5 feet but the majority of tracks in the North had a 4-foot 9-inch gauge (more or less). So after much planning, over a concentrated two-day period in the summer of 1886, the width of thousands of miles of railroad track (and the wheels on thousands of rail cars) in the South was reduced by three inches.

Only one rail would be moved in on the day of the change, so inside spikes were hammered into place at the new gauge width well in advance of the change, leaving only the need for a few blows of the sledgehammer once the rail was placed. As May 31 drew near, some spikes were pulled from the rail that was to be moved in order to reduce as much as possible the time required to release the rail from its old position. Rolling stock, too, was being prepared for rapid conversion. Contemporary accounts indicate that dish shaped wheels were provided on new locomotives so that on the day of the change, reversing the position of the wheel on the axle would make the locomotive conform to the new gauge. On some equipment, axles were machined to the new gauge and a special ring positioned inside the wheel to hold it to the 5-foot width until the day of the gauge change. Then the wheel was pulled, the ring removed, and the wheel replaced. To shorten the axles of rolling stock and motive power that could not be prepared in advance, lathes and crews were stationed at various points throughout the South to accomplish the work concurrently with the change in track gauge.

And you thought deploying software was difficult.

Update: In their book Information Rules, Carl Shapiro and Hal Varian point out that sometimes having different standards from the norm is a good thing.

As things turned out, having different gauges was advantageous to the South, since the North could not easily use railroad to move its troops to battle in southern territory during the Civil War. Noting this example, the Finns were careful to ensure that their railroads used a gauge different from the Russian railroads! The rest of Europe adopted a standard gauge, which made things easy for Hitler during World War II: a significant fraction of German troop movements in Europe were accomplished by rail.

They also describe the efforts that the South went through to support the stronger standard of the North without switching over:

In 1862, Congress specified the standard gauge for the transcontinental railroads. By this date, the southern states had seceded, leaving no one to push for the 5-foot gauge. After the war, the southern railroads found themselves increasingly in the minority. For the next twenty years, they relied on various imperfect means of interconnection with the North and West: cars with a sliding wheel base, hoists to lift cars from one wheel base to another, and, most commonly, a third rail.

At home, I have a drawer full of sliding wheel bases and third rails in the form of Euro-to-US & Asia-to-US power adapters.