Add write database config file if database environment exists