We use the integrable Kaup-Boussinesq shallow water system, modified by a small viscous term, to model the formation of an undular bore with a steady profile. The description is made in terms of the corresponding integrable Whitham system, also appropriately modified by viscosity. This is derived in Riemann variables using a modified finite-gap integration technique for the Ablowitz-Kaup-Newell...