Moved local settings copy to before syncdb to ensure if database values are set in there, they are used for syncdb.