Sync everything to MiCloud. Once you do a factory reset, sign in to your MIUI Account, there will be option to restore everything again from MiCloud to Phone (Including apps). Just be sure you have a fast WiFi to do this since restoring the apps from MiCloud I think took longer time than...