Patch new boot.img from OTA with Magisk then save that file in your adb tools folder. In Magisk, click on restore images. This will unroot. Proceed with the OTA update. After OTA downloaded, install and reboot your phone. After update completes, reboot into bootloader and flash new Magisk patched file. Fastboot flash boot magisk_patched.img and reboot your phone. You will have updated OTA and be rooted again without effecting your data on device. Another way is to download the full new update, open the flash-all.bat file as text editor and where the update is listed, remove the -w before it. Then save it. Double click the flash-all.bat file and the new update will install. In this second option, you can update while you are still rooted, however in either case, you will not be rooted after update and will need to flash the Magisk patched img to gain root access again