How to backup MikroTik RouterOS license to a file

On the terminal (or via SSH / Telnet), run the following command:

/system license print file="License.txt"

Now you can find the file under Files in WebFig: