Both solar wind and ionospheric sources contribute to the magnetotail plasma sheet, but how their contribution changes during a geomagnetic storm is an open question. The source is critical because the plasma sheet properties control the enhancement and decay rate of the ring current, the main cause of the geomagnetic field perturbations that define a geomagnetic storm. Here we use the solar wind composition to track the source and show that the plasma sheet source changes from predominantly solar wind to predominantly ionospheric as a storm develops. Additionally, we find that the ionospheric plasma during the storm main phase is initially dominated by singly ionized hydrogen (H+), likely from the polar wind, a low energy outflow from the polar cap, and then transitions to the accelerated outflow from the dayside and nightside auroral regions, identified by singly ionized oxygen (O+). These results reveal how the access to the magnetotail of the different sources can change quickly, impacting the storm development.