To ensure your data is safe, use the backup feature in your phone. Your device data (such as Wi-Fi passwords and call history) and app data (such as settings and files stored by apps) will be backed up remotely.
Switch on automatic backup
Tap Settings > Backup & reset, and switch Back up my data to On.
Tap Backup account to select to which account your data will be backed up.