$ bitcoin-cli backupwallet
The
backupwallet command simply creates a copy of your wallet.dat file at the location provided in the command:
backupwallet "destination"
Safely copies current wallet file to destination, which can be a directory or a path with filename.
Arguments:
1. destination (string, required) The destination directory or file
It is the same as using "File -> Backup wallet..." option in the GUI... or simply manually copying the wallet.dat file (after bitcoind/Bitcoin Core is shut down properly)