Fixed syncdb function, supporting production.conf

Fixed syncdb function, supporting production.conf