by
Shu
» 27 Sep 2014, 17:22
I suppose you do have the HeidiSQL tool installed alongside MariaDB, and you stopped the dedicated server. (Otherwise you might get inconsistent data in your backups.)
To backup your entire LiF DB:
1) Start HeidiSQL and connect to your DB
2) Select "Tools -> Database SQL Export"
3) In the left tree expand the root node and check the "lif_1" schema
4) On the right side leve the checkboxes empty
5) Under "Data" select "DELETE + INSERT"
6) Leave "Output" as "Single .sql file"
7) Enter a path and filename for your backup file
8) Press "Export" at the bottom of that window
To backup the stored procedures proceed in the same way, but instead of checking "lif_1" in the tree, expand "information_schema" and check the table "ROUTINES". Everything else stays the same, but make sure you give another filename or it will override your LiF data backup!
To apply the patch, go to "File -> Open SQL-file" in HeidiSQL. Locate your "patch.sql" file and open it.
Make sure you have the "lif_1" schema selected on the left, and run the script.
To do so, you need to click the little down-arrow right to the blue "play" button in the tool bar and select "send multiple queries in one go" (translated from German, may be called a bit differently). Otherwise running it would produce an error, but not destroy anything. Run the script then by clicking said blue play button.
If anything bad happened, you can restore your old DB using the same Open SQL-file function. Just load your exported backup files and run them. (You might be asked if it should be run directly, since opening it in the editor could be slow due to its size. Perfectly viable option.)
In both cases always make sure you selected the correct target schema on the left side before running the scrips.
If anything is still unclear, feel free to ask away.