How to prepare for an openwrt upgrade

I wish to update my system to the latest version of openwrt. Currently I'm using 22.03.
Is there something can I can lost in such operation?
I suppose that network interfaces settings will be retained, as other system settings (startup and mount points). Am I right?
But I have also installed several optional packages, as for example ttyd, luci-app-commands (wich each add an entry to openwrt uci) and cryptsetup.
Is there any way to have such optional packages automatically installed after the upgrading?
Thank you.

Biggest challenge will be wolfssl->mbedtls switch.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board

Maybe or maybe not…
Or more like this, they will be retained if you choose to. If it will work afterwards is another question.
It mostly depends on your undefined router model DSA status.

# ubus call system board
{
        "kernel": "5.10.120",
        "hostname": "EA7300",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "Linksys EA7300 v2",
        "board_name": "linksys,ea7300-v2",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.0-rc4",
                "revision": "r19426-2b1941e47d",
                "target": "ramips/mt7621",
                "description": "OpenWrt 22.03.0-rc4 r19426-2b1941e47d"
        }
}

I don't find any password, mac and ip address.

First you upgrade to 22.03.any release from rc using auc
i.e
auc -n -y
Then download sysupgrade file for eventual recovery
Backup config from web UI.
auc
Perform upgrade to 22 release

Upgrade to 23.05 requires luci-app-attendedsysupgrade where you can manually replace wolfssl packages to mbedtls ones.
If you do not have massive packages added like samba, usb drives etc you can just sysupgrade from downloaded clean image. Usually basic settings are migrated.

Thank you for suggesting me auc which I didn't know.
After reading the documentation, I've installed the luci version.
The creation of sysupgrade image failed. I attach here the log. Can you tell me what's the problem and how can I solve? Thank you.

Error building the firmware image
Server response: Error: Impossible package selection

Please report the error message and request
Request Data:

{
    "url": "https://sysupgrade.openwrt.org",
    "revision": "r19426-2b1941e47d",
    "advanced_mode": "0",
    "branch": "22.03",
    "efi": null,
    "profile": "linksys,ea7300-v2",
    "target": "ramips/mt7621",
    "version": "22.03.7",
    "packages": [
        "auc",
        "base-files",
        "block-mount",
        "busybox",
        "ca-bundle",
        "cgi-io",
        "cryptsetup",
        "dnsmasq",
        "dropbear",
        "e2fsprogs",
        "firewall4",
        "fstools",
        "fwtool",
        "getrandom",
        "hostapd-common",
        "hub-ctrl",
        "iwinfo",
        "jansson",
        "jshn",
        "jsonfilter",
        "kernel",
        "kmod-crypto-crc32c",
        "kmod-crypto-ecb",
        "kmod-crypto-hash",
        "kmod-crypto-misc",
        "kmod-crypto-user",
        "kmod-crypto-xts",
        "kmod-fs-ext4",
        "kmod-fs-ntfs",
        "kmod-fs-vfat",
        "kmod-gpio-button-hotplug",
        "kmod-leds-gpio",
        "kmod-lib-crc-ccitt",
        "kmod-lib-crc32c",
        "kmod-loop",
        "kmod-mt7603",
        "kmod-mt7615-firmware",
        "kmod-mt7615e",
        "kmod-nf-conntrack",
        "kmod-nf-conntrack6",
        "kmod-nf-flow",
        "kmod-nf-log",
        "kmod-nf-log6",
        "kmod-nf-nat",
        "kmod-nf-nat6",
        "kmod-nf-reject",
        "kmod-nf-reject6",
        "kmod-nfnetlink",
        "kmod-nft-core",
        "kmod-nft-fib",
        "kmod-nft-nat",
        "kmod-nft-nat6",
        "kmod-nft-offload",
        "kmod-ppp",
        "kmod-pppoe",
        "kmod-pppox",
        "kmod-slhc",
        "kmod-usb-net-rndis",
        "kmod-usb-storage",
        "kmod-usb-storage-uas",
        "kmod-usb3",
        "libblobmsg-json",
        "libiwinfo",
        "libiwinfo-data",
        "libiwinfo-lua",
        "libjson-c",
        "libjson-script",
        "liblua",
        "liblucihttp",
        "liblucihttp-lua",
        "libmnl",
        "libnftnl",
        "libnl-tiny",
        "libubox",
        "libubus",
        "libubus-lua",
        "libuci",
        "libuclient",
        "libucode",
        "libustream-wolfssl",
        "libwolfssl",
        "logd",
        "lua",
        "luci",
        "luci-app-advanced-reboot",
        "luci-app-attendedsysupgrade",
        "luci-app-commands",
        "luci-app-firewall",
        "luci-app-opkg",
        "luci-app-samba4",
        "luci-app-ttyd",
        "luci-base",
        "luci-lib-base",
        "luci-lib-ip",
        "luci-lib-jsonc",
        "luci-lib-nixio",
        "luci-mod-admin-full",
        "luci-mod-network",
        "luci-mod-status",
        "luci-mod-system",
        "luci-proto-ipv6",
        "luci-proto-ppp",
        "luci-ssl",
        "luci-theme-bootstrap",
        "mtd",
        "nano",
        "netifd",
        "nftables-json",
        "ntfs-3g",
        "ntfs-3g-utils",
        "odhcp6c",
        "odhcpd-ipv6only",
        "openwrt-keyring",
        "opkg",
        "ppp",
        "ppp-mod-pppoe",
        "procd",
        "procd-seccomp",
        "procd-ujail",
        "px5g-wolfssl",
        "rpcd",
        "rpcd-mod-file",
        "rpcd-mod-iwinfo",
        "rpcd-mod-luci",
        "rpcd-mod-rrdns",
        "samba4-server",
        "smartmontools",
        "ttyd",
        "ubi-utils",
        "uboot-envtools",
        "ubox",
        "ubus",
        "ubusd",
        "uci",
        "uclient-fetch",
        "ucode",
        "ucode-mod-fs",
        "ucode-mod-ubus",
        "ucode-mod-uci",
        "uhttpd",
        "uhttpd-mod-ubus",
        "unzip",
        "urandom-seed",
        "urngd",
        "usbutils",
        "usign",
        "wpad-basic-wolfssl"
    ],
    "diff_packages": true,
    "filesystem": "squashfs",
    "client": "luci/git-23.093.42303-58b861d"
}
STDERR:
Generate local signing keys...
Generate local certificate...
Package list missing or not up-to-date, generating it.

Building package index...
Downloading https://downloads.openwrt.org/releases/22.03.7/targets/ramips/mt7621/packages/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_core
Downloading https://downloads.openwrt.org/releases/22.03.7/targets/ramips/mt7621/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_base
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_luci
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_packages
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_routing
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/22.03.7/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.
Downloading file:packages/Packages
Updated list of available packages in /builder/build_dir/target-mipsel_24kc_musl/root-ramips/../../../../builder/dl/imagebuilder
Downloading file:packages/Packages.sig
Signature check passed.
Collected errors:
 * opkg_install_cmd: Cannot install package kmod-nft-nat6.
make[2]: *** [Makefile:172: package_install] Error 255
make[1]: *** [Makefile:137: _call_manifest] Error 2
make: *** [Makefile:257: manifest] Error 2

So, the package is superfluous. Can I delete it from my current system or there is another correct way to exclude it from sysupgrade?

auc will do that automatically, using the package_changes defined in https://sysupgrade.openwrt.org/json/v1/overview.json, no need to use LuCI ASU.

Yeah, it was dropped in rev 19160. Again auc will fix this automatically using the package_changes. LuCI ASU does not implement the package changes functionality, so better to either use auc or the Firmware Selector (where you'd do it manually with a -kmod-nft-nat6 in the package list).