The visiting pupils dressed up in 19th-century period costumes during an educational session at the museum yesterday afternoon, and some of them later also spent the night in wooden bunks in the museum's popular "Across the Ocean Waves" exhibition.
Other pupils slept elsewhere in the museum.
This interactive exhibition, which opened to the public in 2004, introduces visitors to the sights and sounds, as well as the extremely cramped conditions in sleeping quarters, aboard sailing ships bringing early European immigrants to Otago in the 19th century.
Museum exhibitions team leader Jennifer Evans said it was the first time school pupils had spent the night in the museum's simulated ship sleeping quarters, after a request from school authorities.
Cruise-ship visitors had also experienced the exhibition yesterday as part of a museum presentation about Dunedin's "Scottish story".
The cruise-ship passengers were struck by the contrast between the comfortable conditions in which they were travelling and the conditions aboard the early migrant ships.