Moving a large MariaDB database between MariaDB servers
At my job, we do this several times per week. I'm part of a team who manages about 9000 MySQL database instances, and we're constantly moving them from server to server as they grow.
NOTE: You cannot just copy files from a MySQL / MariaDB datadir while the server is running. You are virtually guaranteed to corrupt your database. Some subset of the data is in log files or in RAM, and it won't be copied with consistency.
We do it this way:

Use Percona XtraBackup to make a physical backup. It doesn't take long, even for a multi-hundred-GB database instance.

Transfer this backup to the other host.

Restore the backup on that new host.

Configure replication on the new host, to subscribe to changes on the original host. This allows it to &quot;catch up&quot; to all the changes that occurred while you were transferring the file and restoring them.

Wait for the new instance to catch up.

Set the original instance to be read-only, so applications can't make any new changes. Then let the replica catch up with respect to the final few seconds of changes (this might take no time at all).

Update applications to use the new server instead of the old one. This is done either by changing configuration in the app, or else just use DNS to give the name of the original server to the new server.


This is all assuming you want the whole MySQL instance to be moved to a new server. If you have individual schemas in the original server that you want to move, that's a bit more complicated.