restore db, add middileware directory.