Let $f:X\to U$ be a projective morphism of normal varieties and $(X,\Delta)$
a dlt pair. We prove that if there is an open set $U^0\subset U$, such that
$(X,\Delta)\times_U U^0$ has a good minimal model over $U^0$ and the images of
all the non-klt centers intersect $U^0$, then $(X,\Delta)$ has a good minimal
model over $U$. As consequences we show the existence of log canonical
compactifications for open log canonical pairs, and the fact that the moduli
functor of stable schemes satisfies the valuative criterion for properness.