Hi, @Mumay Welcome to Microsoft Q&A Thanks for posting your query.
If this is MySQL on Windows, I am not 100% sure about this.
If it is Linux, data files act as cold backup and configuration (my.cnf) / MySQL version and installation of the new server has to be same as previous VM/PC with modification to datadir and valid permissions on the directory.
Regards
Geetha