backup sqldatabase, and add logintype function