My Asterisk/MariaDB database and call recording storage is growing very fast with the volume of calls handled by our server, my plan is to install a secondary server and move all data older then 3 months to the secondary server.
How can I export and import all Data Records (CDR), Call Event Log (CEL) and call recordings from the primary to secondary server?
How can I defrag the MariaDB database to regain the disk space?
For some more control, there’s the FreePBX Backup & Restore module command-line utilities.
Digressing a bit, but another command-line way to do it might include maria-dump and rsync, which would perhaps be the best choices if your target “secondary server” is not running FreePBX (wasn’t clear from your post.)