Sandy sediments of lowland streams are transported as migrating ripples. Benthic microorganisms colonizing sandy grains are exposed to frequent moving-resting cycles and are believed to be shaped by two dominant environmental factors: mechanical stress during the moving phase causing biofilm abrasion, and alternating light-dark cycles during the resting phase. Our study consisted of two laboratory experiments and aimed to decipher which environmental factor causes the previously observed hampered sediment associated microbial activity and altered community structure during ripple migration. The first experiment tested the effect of three different migration velocities under comparable light conditions. The second experiment compared migrating and stationary sediments under either constant light exposure or light oscillation. We hypothesized that microbial activity and community structure would be more strongly affected by 1) higher compared to lower migration velocities, and by 2) light oscillation compared to mechanical stress. Combining the results from both experiments, we observed lower microbial activity and an altered community structure in sediments exposed to light oscillation, whereas migration velocity had less impact on community activity and structure. Our findings indicate that light oscillation is the predominating environmental factor acting during ripple migration, resulting in an increased vulnerability of light-dependent photoautotrophs and a possible shift towards heterotrophy.