A fundamental property of many associative memory networks is the ability to decorrelate overlapping input patterns before information is stored. In the hippocampus, this neuronal pattern separation is expressed as the tendency of ensembles of place cells to undergo extensive 'remapping' in response to changes in the sensory or motivational inputs to the hippocampus. Remapping is expressed under some conditions as a change of firing rates in the presence of a stable place code ('rate remapping'), and under other conditions as a complete reorganization of the hippocampal place code in which both place and rate of firing take statistically independent values ('global remapping'). Here we show that the nature of hippocampal remapping can be predicted by ensemble dynamics in place-selective grid cells in the medial entorhinal cortex, one synapse upstream of the hippocampus. Whereas rate remapping is associated with stable grid fields, global remapping is always accompanied by a coordinate shift in the firing vertices of the grid cells. Grid fields of co-localized medial entorhinal cortex cells move and rotate in concert during this realignment. In contrast to the multiple environment-specific representations coded by place cells in the hippocampus, local ensembles of grid cells thus maintain a constant spatial phase structure, allowing position to be represented and updated by the same translation mechanism in all environments encountered by the animal.