From 45764933a963acf5014589721a43fc7e2ccea04e Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 21 Dec 2008 13:26:03 +0000 Subject: [PATCH] document backup git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@220 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- doc/prog_protocol.html | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/doc/prog_protocol.html b/doc/prog_protocol.html index 77309f5..94a1a3c 100644 --- a/doc/prog_protocol.html +++ b/doc/prog_protocol.html @@ -803,3 +803,56 @@ The settemplatedescription transaction sets a new description for a tem

Deleting a Template

The deletetemplate transaction deletes a template from the database. The request contains the file name (full name). The response is empty. The transaction does not return any errors. + + + +

Backup

+ +The currently implemented backup function is DB scheme dependent. This may change in the future.

+ +The machine interface only provides for the retrieval of the backup file. Restoration is done via admin.php.

+ +The backup transaction is used to retrieve a backup file. It does not have any parameters. The response is in the special backup format:

+ +

+startbackup
+backupversion 0
+dbversion 00.02
+table exampletab
+value stringcolumn str TWFnaWNTbW9rZVZlcnNpb24=
+value intcolumn int 1
+value boolcolumn bool 1
+value anothercolumn NULL NULL
+insert
+endofbackup
+
+ +The format is command oriented: each line is a specific command that can be interpreted by the restore processor: + + + + + + + + + + +
CommandDescription
startbackupmarks the begin of a backup file
backupversiondefines the format version (integer version number) of this backup file - this only shows which commands are valid, not what content can be transferred
dbversionversion of the database scheme this data is taken from
tablemarks the start of a new table, has the (scheme-)name of the table as parameter, deletes the current dataset buffer
valueadds a value to the current dataset buffer, parameters are the column name, encoding format and value
insertpushes the current dataset buffer into the current table, then empties the dataset buffer
endofbackupmarks the end of the backup file, the processor should stop here

+ +Table cell values are encoded according to the content in the source database. The target database must decode the values according to the format used in the backup file and then escape the value as appropriate for the target database (irrespective of the just decoded source format).

+ +The following encoding formats are currently known: + + + + + + +
FormatDescription
NULLa NULL value, the actual value in the backup file does not matter, the target value is NULL
intinteger, the value must be converted into an integer number
boolboolean, the value "1" means true, the value "0" means false, everything else is an error and should be interpreted as NULL
strstring or blob, the content is base64 encoded - if it is a string the result of base64 decoding is in UTF-8 encoding
+ + + + \ No newline at end of file -- 1.7.2.5