Run DB Sync only after generating the config

Otherwise it will not be able to connect to the
database.