move db codes to server