This is one simple code used by a small user:
- Code: Select all Expand view
DEFINE BUTTON OF oBar PROMPT "BackUp" ACTION ( ;
CursorWait(), ;
MsgInfo( cn():BackUp( nil, "g:\vp_act\mybackup\" ) + " Created" ) )
The user clicks the button everyday when leaving.
What does this simple code
- Code: Select all Expand view
cn():BackUp( nil, "g:\vp_act\mybackup\" )
do?
First parameter is nil. That means the entire "database" currenly selected is backedup. This back up includes all tables, views and all objects like stored procedures, functions, triggers, etc.
Second parameter "g:\vp_act\mybackup\" is a folder name. Not a file name. In this case, the backup file "<databasename>.sql" is created in a subfolder with the name of the week.
Eg:
"g:\vp_act\mybackup\SUNDAY\databasename.sql"
"g:\vp_act\mybackup\MONDAY\databasename.sql"
"g:\vp_act\mybackup\TUESDAY\databasename.sql"
....
"g:\vp_act\mybackup\SATURDAY\databasename.sql"
In addition, he mapped "G:" drive to his GoogleDrive.
So at any point of time, he has seven days backups on his google drive.
He has his main database on a cloud server.
Even if all his office computers are damaged, he is safe.
He still has data on a cloud server. Even if that goes, he still has seven days backups on Google Cloud..
Backup() method has many features. This is one way one user has used.
Encryption:
It is extremely easy to encrypt our backups, compared with any 3rd party utility.
- Code: Select all Expand view
MYSQL_ENCRYPTKEY( <yourkey> )
oCn:BackUp( ... )
MYSQL_ENCRYPTKEY( nil )
Now, even if our backups fall into the hands of any third party, there is no worry.
Dolphin/TMySql/ADO:
It does not matter whether your main application uses Dolphin, TMySql or ADO.
FW native libs easily coexists with them.
- Code: Select all Expand view
oFwCon := maria_Connect( oDolphinSever )
// OR
oFwCon := maria_Connect( oTMySqlCon )
// OR
oFwCon := maria_Connect( oAdoConn )
oFwCon:BackUp( ... )
oFwCon:Close()