import VM from proxmox 5.1-41 to proxmox 9

Can I migrate import/export my virtual machines currently running on Proxmox VE 5.1-41 to Proxmox VE 9 without any risk? What would be the recommended and safest migration method to ensure that the VMs do not crash, fail to boot, or encounter compatibility issues after the migration, and that they continue to operate normally?