I had some troubles re-installing mariadb - files were missing and old installation files were used. Here are the steps how I optimised the configuration and changed the data-dir.