We study the roughening transition of a (3+1)-dimensional elastic manifold, which is driven by the competition between a periodic pinning potential and a random impurity potential. The elastic manifold is modeled by a solid-on-solid-type interface model, and the universal properties of the transition from a flat phase (for strong periodic potential) to a rough phase (for strong random potential...