Backup File Definitions>>
Brimbox backups can be downloaded and come in two standard types, encrypted and not encrypted (or unencrypted). The encrypted backup uses the current admin password when encrypting, so when decrypting (or restoring) the password used when backing up the file must be provided. Note when restoring the users_table from backup users credentials may revert to older credentials, so passwords may be reverted. Although the unencrypted backup file also requires a password when restoring in Brimbox, the data can be accessed directly from the file by a PHP programmer (see below).
If you backup a file, you must have the password used when backing up to restore it.
To restore a Brimbox database to a previous version go to the “Admin” tab and click the “Backup and Restore” button.
Important note: PHP variables
post_max_size must be larger than your backup file size. If they are not, Brimbox will generally reset to the Home tab without any notices. These variables can be set in
php.ini relevant settings regarding file uploads
file_uploads = On
upload_max_filesize = 8M
post_max_size = 8M
The backup file formats are such:
- 8 chars defining the backup format
- 32 chars md5 salt
- 128 chars sha512 hash made from salt and password
Datalines for both formats are in base64 terminated by a CRLF (or rn), to get a line use
$line = rtrim(fgets($file_handle));
$line = base64_encode(gzdeflate($line));
$line = gzinflate(base64_decode($line));
Encrypted: will require password to decrypt
$line = base64_encode(mcrypt_encrypt(($parameters...gzdeflate($line)));
$line = gzinflate(mcrypt_decrypt($parameters...base64_decode($line)));