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 > System > Backup, and switch back up on.