After several years of quiescence, the blazar CTA 102 underwent an exceptional outburst in 2012 September-October. The flare was tracked from γ -ray to near-infrared (NIR) frequencies, including Fermi and Swift data as well as photometric and polarimetric data from several observatories. An intensive Glast-Agile support programme of the Whole Earth Blazar Telescope (GASP-WEBT) collaboration campaign in optical and NIR bands, with an addition of previously unpublished archival data and extension through fall 2015, allows comparison of this outburst with the previous activity period of this blazar in [2004][2005]. We find remarkable similarity between the optical and γ -ray behaviour of CTA 102 during the outburst, with a time lag between the two light curves of ≈1 h, indicative of cospatiality of the optical and γ -ray emission regions. The relation between the γ -ray and optical fluxes is consistent with the synchrotron self-Compton (SSC) mechanism, with a quadratic dependence of the SSC γ -ray flux on the synchrotron optical flux evident in the post-outburst stage. However, the γ -ray/optical relationship is linear during the outburst; we attribute this to changes in the Doppler factor. A strong harder-when-brighter spectral dependence is seen both the in γ -ray and optical non-thermal emission. This hardening can be explained by convexity of the UV-NIR spectrum that moves to higher frequencies owing to an increased Doppler shift as the viewing angle decreases during the outburst stage. The overall pattern of Stokes parameter variations agrees with a model of a radiating blob or shock wave that moves along a helical path down the jet.