Collection sites and environmental properties. a Coral sites at Racha Island and Panwa reef flat in the Andaman Sea south of Phuket Island in Thailand (red rectangle). The impact of large-amplitude internal waves creates high variability habitats on the western shore of Racha Island (light green arrow). At the shallow reef flat in Panwa, high variability and extreme conditions are linked to diurnal solar and tidal variation. b Three distinct reef sites were selected: a high variability west shore site of Racha Island (“HighVar,” 15 m depth, light green); a high variability reef flat in Phuket Island, Panwa (“HighVar,” 0–2 m depth, orange); and a sheltered low variability reef site of stable environmental conditions at Racha Island east shore (“LowVar,” 15 m, teal). Corals from “HighVar” environments were designated as microbiome donors, whereas corals from the “LowVar” site were used as recipients during microbiome transplantation experiments. c, d In situ temperature profiles show the temperature history of corals prior to experiments. Strong fluctuations of temperature were measured at the “HighVar” west shore site (light green in c) and reef flat (orange in d), while comparably stable conditions are shown for the “LowVar” east shore site (teal in c and d). Branching coral, Pocillopora sp.; massive coral, Porites sp.