  The paper describes the commissioning of the experimental equipment and the
machine studies required for the first spin-filtering experiment with protons
at a beam kinetic energy of $49.3\,$MeV in COSY. The implementation of a
low-$\beta$ insertion made it possible to achieve beam lifetimes of
$\tau_{\rm{b}}=8000\,$s in the presence of a dense polarized hydrogen
storage-cell target of areal density $d_{\rm t}=(5.5\pm 0.2)\times
10^{13}\,\mathrm{atoms/cm^{2}}$. The developed techniques can be directly
applied to antiproton machines and allow for the determination of the
spin-dependent $\bar{p}p$ cross sections via spin filtering.
