Creates a compressed backup file, containing a metadata json file and the current state of the database. This file can be encrypted with the provided password if it is not empty. Otherwise, the file will be unencrypted.