Ported ReplaceDatabase, wrapping up Manager ports.