The Sun is our nearest star; it is a dynamic star, which changes with time. Solar variations have significant influence on Earth's space environment and climate through the Sun's magnetic field, irradiation and energetic particles. Long-term and reliable historical datasets of solar and stellar activity indices are crucial for understanding the variations and predicting the future solar cycle. IAU Symposium 340 brings together scientists from diverse, interdisciplinary areas to address the latest discoveries from these long-term datasets for the understanding of solar and stellar magnetic cycles. They make comparisons between different datasets and discuss how to make uniform databases. The proceedings of IAU S340 contain a selection of presentations and reviews from internationally renowned experts. They provide an up-to-date account of this field of importance to researchers and advanced students in solar, stellar, space and heliospheric physics.