- openssl
- zip
final Cipher instance = Cipher.getInstance("AES/CBC/NoPadding");
instance.init(2, new SecretKeySpec("bcyangkmluohmars".getBytes(), "AES"), new IvParameterSpec("ubntenterpriseap".getBytes()));
return new CipherInputStream(inputStream, instance);
malformed zip files require fixing before unzip
db.gz
contains a stream of BSON document for each collections of ace
database.
You can view its content by gunzip -c db.gz | bsondump
.
It should be trivial to write a script that helps import/export. If anybody wants to contribute, PRs are welcomed.
NB: these instructions are for Ubuntu; they work under WSL on Windows 10 as well
Get the decrypt.sh
file from here: https://github.com/zhangyoufu/unifi-backup-decrypt
Make sure prerequisites are installed:
sudo apt update && sudo apt install zip unzip openssl mongo-tools
Then put your .unf backup file somewhere convenient (for our example, we'll assume it's in the home directory and named backup.unf
):
bash decrypt.sh ~/backup.unf ~/backup.zip
mkdir backup
cd backup
unzip ~/backup.zip
gunzip db.zip
bsondump db.zip > db.json
This will:
- convert the .unf into an unencrypted .zip file,
- unzip that into the
backup
directory, - uncompress the backup database
- convert the backup databse from "binary JSON" (bson) to plain text JSON
You can then see the contents of the backup database with any JSON-aware tool or simply read it in a text editor.