The eukaryotic replisome assembles around the CMG helicase, which stably associates with DNA replication forks throughout elongation. When replication terminates, CMG is ubiquitylated on its Mcm7 subunit and disassembled by the Cdc48 / p97 ATPase. Until now, the regulation that restricts CMG ubiquitylation to termination was unknown, as was the mechanism of disassembly. By reconstituting these processes with purified budding yeast proteins, we show that ubiquitylation is tightly repressed throughout elongation by the Y-shaped DNA structure of replication forks. Termination removes the repressive DNA structure, whereupon long K48-linked ubiquitin chains are conjugated to CMG-Mcm7, dependent on multiple replisome components that bind to the ubiquitin ligase SCFDia2. This mechanism pushes CMG beyond a '5-ubiquitin threshold' that is inherent to Cdc48, which specifically unfolds ubiquitylated Mcm7 and thereby disassembles CMG. These findings explain the exquisite regulation of CMG disassembly and provide a general model for the disassembly of ubiquitylated protein complexes by Cdc48.