The encrypted mail passwords are stored in the table 'mailbox' of the database 'postfix'. I think the passwords can be retrieved from the db and restored on the new server. It should work if postfix for Almalinux 9 / RockyLinux 9 uses the same method of encryption.
With the ssh access key, it never worked.
Making backups as you say, I haven't tried it, if that also restores the email key or password, it's a solution.
What you say about them being stored in the table 'mailbox' of the database 'postfix', is a matter of testing, I doubt it's as simple as moving and that it keeps the passwords, but if it is, it's a very good solution.
Now I'm going to do something else (you know, the MariaDB upgrade) but this week, I'll get a server with AlmaLinux 9, I'll put cwp9 on it, and if you want, we'll start testing.