Best way to move MariaDB data AND users to new server

  • So basically I now have a dedi once again because i'm running out of RAM and hetzner had some good deals. the problem is i want to move all the databases and users to the new server. i know i can use phpmyadmin or mysqldump, but thats for the databases. i tried to copy the tables from mysql that some guy on the internet said would work. unfortunately that nuked everything and it was so bad i had to actually reinstall the entire OS. any suggestions for how to get all the users and stuff copied over? thanks

    and note this is mariadb 10.6.7. both servers are using the exact same version, 10.6.7. i'm not trying to do anything weird like go from mysql to mariadb. it's mariadb to mariadb on the exact same version and configuration, just one has no data.