Context. EX Lupi is the prototype of EXor variables. After 50 years of mild variability and smaller outbursts, the object again experienced a large outburst in 2008. Aims. We explore the accretion mechanisms in EX Lupi during its pre-outburst, outburst, and post-outburst phases. Methods. We analyze 10 high-resolution optical spectra of EX Lupi, taken before, during, and after the 2008 outburst. In both quiescence and outburst, the star presents many permitted emission lines. These include lines typical of accreting T Tauri stars, plus a large number of neutral and ionized metallic lines (mostly Fe I and Fe II). During the outburst, the number of emission lines increases to about a thousand, and their structure shows a narro...