[Moto G Stylus 5G] ragarcia87:
No worries at all, I'll explain how I do OTA without losing data...

The way I do it is using motoflash2sh or similar method to convert the flashfile.xml to fastboot format, then I remove the parts that would flash and format the userdata. Below is an example of the generated fastboot script and from the script I would remove the lines
fastboot erase userdata || exit 1
fastboot erase metadata || exit 1

Those are the most important that you don't want to erase, userdata obviously is your data and the metadata is what holds the decryption key for your data so you'll need to make sure they are both intact. That should allow you to update OTA without losing data.

I think when I did it last I actually removed these lines
fastboot erase carrier || exit 1
fastboot erase userdata || exit 1
fastboot erase metadata || exit 1
fastboot erase ddr || exit 1

Anyways, hope that helps. Please excuse my long post however I wanted to share the way I do it. Now, you will have to redo the sequence of fastboot boot twrp.img and then redo the process of injecting the ramdisk of TWRP back into the new boot.img that was flashed and then flash the Magisk.zip again... This is just cause of the new boot.img that is flashed during OTA...

#!/bin/sh -x

cd ""

# <header>
# <phone_model model="denver_global" />
# <software_version version="denver_global-user 12 S2RES32.29-16-1-5 c4167-b6ebd release-keysM4350_HI431_41.1123.01.84R" />
# <subsidy_lock_config MD5="e564ee6b429d585b6af57304fafaac31" name="slcf_rev_d_boost_dish_v2.2.nvm" />
# <regulatory_config SHA1="da39a3ee5e6b4b0d3255bfef95601890afd80709" name="regulatory_info_default.png" />
# <cid_template_config SHA1="cfc1136c36955ba5ffe514efdf0037e95e47bef3" name="cid_template.dat" />
# <sparsing enabled="true" max-sparse-size="536870912" />
# <interfaces>
# <interface name="AP" />
# </interfaces>
# </header>

md5sum --check <<EOF || exit 1
aa62e4245f4c04cde7de53a39afbd655 *gpt.bin
1457273247b6647e7a840263fc1c8743 *bootloader.img
a0c9d006bb33c646599d12ce64b74e87 *vbmeta.img
258334bc37dfe16b4b2df3e68a5b3168 *vbmeta_system.img
f5ad1817a5c781d485b12908b27cdcd4 *radio.img
cdb2152a024986f207ae868d03f59144 *BTFM.bin
7a2af0230c857b10759be5b87986687a *dspso.bin
69293ed09102d7440f9405ce23d0eceb *logo.bin
a374bda2d21c205a27f79a2dedc89bca *boot.img
926f938feaec4337c6cd5a00dbe458ce *vendor_boot.img
6432965406a9a99ec8ccddacd753e1f9 *dtbo.img
abb5ba9bd9770e3fcd5e198c561c6460 *super.img_sparsechunk.0
b11125a60b152af56873fa9f9efc83f5 *super.img_sparsechunk.1
73f4d822fdc372ace9363f20369499d1 *super.img_sparsechunk.2
868807fb9833e6f982d00235c1967014 *super.img_sparsechunk.3
e5783f7d2eef9c2c0ac13f2db4614d49 *super.img_sparsechunk.4
4977964a7c4fb5108d1729ba0d2781d4 *super.img_sparsechunk.5
4e3e2612ecef3d8e49bd5efa0201437e *super.img_sparsechunk.6
6916502936d47b8fd4a7299f567b6845 *super.img_sparsechunk.7
131035034b18a3f7a5153fcaf9dc1f79 *super.img_sparsechunk.8
ad6e83193863ca3c76bba5548b531ca5 *super.img_sparsechunk.9
adec4bf966b45e8ee08684acb5457bd1 *super.img_sparsechunk.10
656777ecb5968ad17474581b86e85bdf *super.img_sparsechunk.11
36239a8f794b7ce54fc63b6188a6b7e5 *super.img_sparsechunk.12
EOF

fastboot getvar max-sparse-size || exit 1
fastboot oem fb_mode_set || exit 1
fastboot flash partition gpt.bin || exit 1
fastboot flash bootloader bootloader.img || exit 1
fastboot flash vbmeta vbmeta.img || exit 1
fastboot flash vbmeta_system vbmeta_system.img || exit 1
fastboot flash radio radio.img || exit 1
fastboot flash bluetooth BTFM.bin || exit 1
fastboot flash dsp dspso.bin || exit 1
fastboot flash logo logo.bin || exit 1
fastboot flash boot boot.img || exit 1
fastboot flash vendor_boot vendor_boot.img || exit 1
fastboot flash dtbo dtbo.img || exit 1
fastboot flash super super.img_sparsechunk.0 || exit 1
fastboot flash super super.img_sparsechunk.1 || exit 1
fastboot flash super super.img_sparsechunk.2 || exit 1
fastboot flash super super.img_sparsechunk.3 || exit 1
fastboot flash super super.img_sparsechunk.4 || exit 1
fastboot flash super super.img_sparsechunk.5 || exit 1
fastboot flash super super.img_sparsechunk.6 || exit 1
fastboot flash super super.img_sparsechunk.7 || exit 1
fastboot flash super super.img_sparsechunk.8 || exit 1
fastboot flash super super.img_sparsechunk.9 || exit 1
fastboot flash super super.img_sparsechunk.10 || exit 1
fastboot flash super super.img_sparsechunk.11 || exit 1
fastboot flash super super.img_sparsechunk.12 || exit 1
fastboot erase carrier || exit 1
fastboot erase userdata || exit 1
fastboot erase metadata || exit 1
fastboot erase ddr || exit 1
fastboot oem fb_mode_clear || exit 1