Method BackUp() returns backup file name.
Method Restore() was returning NIL. Now modified to return .T. on success and .f. on failure.
During development, we kept some msgyesno() for testing. We regret that we forgot to remove them. Now we removed these messages.
Some more enhancements have been made after release of FWH 16.10. Backup/Restrore now handles :
1) Tables with calculated virtual columns.
2) Tables with fields of type geometry.
Binary Data:
Backup/Restore system works perfectly as long as binary data (like images, documents, etc) is stored in BLOB fields but not in TEXT fields. Storing binary data in text fields is not a good practice, though this might seem be working in some cases. Before using backup/restore, please ensure that binary data is not stored in TEXT fields.
TEST:
In case of full installation of recent versions of MySql, with examples, a sample database by name `sakila` is also automatically installed. This database contains tables, views, triggers, stored procedures and functions.
This is a fully normalized database and consequently many tables reference others by foreign keys. In one case there is even mutual referencing. This database is a good example how to normalize our databases.
This database, with all its complexities, is ideal for testing FWH BackUp and Restore functionality.
We executed the following code to backup the database `sakila` and then restore it with another name `sakira`.
[code=fw:21sosebx][/code:21sosebx]
Now we compare the tables of the original database `sakila` with restored database `sakira`.
We used this code to compare the tables. This code can be used to compare other cases also.
[code=fw:21sosebx][/code:21sosebx]
Result of comparison
[url=https://imageshack.com/i/plbawAGPp:21sosebx][img:21sosebx]http://imagizer.imageshack.us/v2/xq90/921/bawAGP.png[/img:21sosebx][/url:21sosebx]
White lines belong to the original database and the blue lines refer to the restored database. This table compares the foreign key relationships also in the original and restored databases.
It may be seen that the tables `store` and `staff` reference each other. Also, the table `address` has a field `location` which is of type "geometry".
After tables, we now compare all other objects with this code.
[code=fw:21sosebx][/code:21sosebx]
This code compares whether all objects are restored or not and also whether the text restored is identical to the original or not.
Result:
[url=https://imageshack.com/i/pm0Orqusp:21sosebx][img:21sosebx]http://imagizer.imageshack.us/v2/xq90/922/0Orqus.png[/img:21sosebx][/url:21sosebx]
These tests on a complex database like `sakila` indicate satisfactory functioning of FWH's Backup/Restore feature.
We welcome more and more tests and feedback.
Note: This functionality is available in the revised build soon to be published.
↧