Officials in China moved some 414,000 people out of the way in Shanghai before the strongest storm in decades flooded roads and cancelled flights.