Climate change and erosion from agricultural areas cause increased drying periods and bedform migration of riverbeds, respectively, worldwide. Both sediment drying and bedform migration can independently stress the microbial community residing in the riverbed. Here, we investigated the microbial response after exposure to these stressors with a focus on long-term recovery. We conducted an in situ experiment to investigate the long-term (8 months) functional and structural recovery of benthic microbial communities from either sediment drying (episodic severe stressor) or bedform migration (frequent moderate stressor). Stressed sediment associated communities were rewetted (dried sediments) and immobilized (migrated sediments) and exposed in the River Spree (north-eastern Germany) to initiate the recovery process. We then evaluated the microbial function (community respiration, net community production and extracellular enzymatic activities) as well as the bacterial, fungal and diatom community structure (16S rRNA gene and ITS region metabarcoding, and microscopic diatom morphotype classification). We observed different recovery times for community respiration (less than 7 days) and gross primary production (more than 5 months), implying a shift toward net heterotrophy in the first few months after stress exposure. Similarly, we observed a strong autotrophic community response (particularly associated with the diatoms Navicula and Fragilaria), especially in migrated sediments. The bacterial and fungal community response to sediment drying was stronger than to bedform migration (particularly associated with the bacterium Flavobacterium and the fungi Alternaria sp. and Aureobasidium pullulans). Our results show that sediment drying and bedform migration had a significant impact on the microbial community function and structure, which persisted for several months after the stress. Due to the surprising long period of recovery, successive stress events combined with seasonal effects will likely hamper the ongoing recovery process with severe alterations to the microbial function and structure. These findings extend the concept of ecosystem resilience and stability on the dimensions of timescale and seasonal environmental variations. Legacy effects are expected to play a key role when facing future stress.