See this: https://severalnines.com/blog/mariadb-backups-what-is-mariabackup/
Ensure DB Is up:
mariabackup --backup --target-dir=/apps/backup/mariadb --user=root --password=P@ssw0rd
Prepare backup:
mariabackup --prepare --target-dir=/apps/backup/mariadb/
Clean up data dir /var/lib/mysql and restore:
mariabackup --copy-back --target-dir=/apps/backup/mariadb/
Chown:
chown -R mysql:mysql /var/lib/mysql/