Backup bckp = new Backup();
bckp.createBackup("secretKey"); // crete backup from database to the .xml file
bckp.importBackup("secretKey"); // import backup to the database
"secretKey"
is the encryption / decryption password
WARNING:
If you enter a different secret key when restoring a backup than when it was created, the database will be restored with corrupted data.
In this case, under no circumstances should you make a copy of this data! Instead, restore the previous copy again with the correct password.
NOTE:
- Database backups are stored in backup.xml file in main directory. See example.
- During next backup new data are overriding old backup. Pay attention to it.
- When importing a backup to the database, all rows are emptied! Please backup your data before importing, keeping to the point 2.