Configure database earlier

Change-Id: Ic334e27b5421d1ed34f3ab6cf067bf1f42cf213c