How to backup database only (without uploads) from console?

I got interested in the subject and read a lot of threads. My conclusion is that it is even safe to restore copies straight from the console to avoid bugs - generally how to do it correctly ?