There will be no data loss when you switch to Windows 11. The files, apps, as well as activation code all will be preserved.