Observations of Sun-like stars over the last half-century have improved our understanding of how magnetic dynamos, like that responsible for the 11-year solar cycle, change with rotation, mass and age. Here we show for the first time how metallicity can affect a stellar dynamo. Using the most complete set of observations of a stellar cycle ever obtained for a Sun-like star, we show how the solar analog HD 173701 exhibits solar-like differential rotation and a 7.4-year activity cycle. While the duration of the cycle is comparable to that generated by the solar dynamo, the amplitude of the brightness variability is substantially stronger. The only significant difference between HD 173701 and the Sun is its metallicity, which is twice the solar value. Therefore, this provides a unique opportunity to study the effect of the higher metallicity on the dynamo acting in this star and to obtain a comprehensive understanding of the physical mechanisms responsible for the observed photometric variability. The observations can be explained by the higher metallicity of the star, which is predicted to foster a deeper outer convection zone and a higher facular contrast, resulting in stronger variability.