Coral: dbbackup detail
Db Backup - Detail The Uniform Server's database backup allows for either manual or periodic backups. Each database is extracted from the MySQL server in SQL format. The archive files consist of a database name with a unix time stamp appended. For example fred_1306863938_.sql. These are saved to folder UniServer\db_backup (created automatically). Archive files can become large (they eat disk space). To minimise this, the archive folder implements a FIFO (first in first out) deletion. The total number of files for each database is user specifiable (default 3). On reaching this value the eldest file is deleted to make way for a new archive file. The above applies to both manual and automatic updates (Using Cron).
|
|
Edit DB Backup Config
Uniform Server DB Backup is configured via a configuration file db_backup.ini. This has been pre-configured sets the FIFO depth to 3 and enables logging by default.
You can open this configuration file in one of two ways either using UniController or directely.
UniController: Open file as follows:
Server Configuration > DB Backup > Edit DB Backup Config
Alternatively open the file directly.
Directly: Open the following file in notepad or other suitable text editor: UniServer\uni_con\db_backup\db_backup.ini
Configuration
|
;####################### [FIFO] Fifo_depth = 3 [LOG] Logging = true ;=== END Config ======== |
Note: FIFO size is a compromise between database size, disk space and how often backups are required. Three is just a test value and should be changed to suit your particular requirements.
Force DB Backup
You can force a database backup either using UniController or directly by running the batch file Run_db_backup.bat. Either method assumes you have entered databases to the file list see section to be backed up.
UniController:
Server Configuration > DB Backup > Force DB Backup
Directely:
UniServer\uni_con\db_backup\Run_db_backup.bat
Enable log
This menu option is identical to "Edit DB Backup Config". It allows you to enable or disable logging.
Server Configuration > DB Backup > Enable log
|
;####################### [FIFO] Fifo_depth = 3 [LOG] Logging = true ;=== END Config ======== |
View Log
Server Configuration > DB Backup > View Log The log file opens in Notepad; an extract from this file is shown on the right. Log file displays date and time a database was backed up. Each file has a time stamp appended to its file name. Note: The log file provides a quick way to check databases are being backed up. This is useful when setting up configuration files such as Cron. |
19/07/2011 22:18:07 ### Log Started =========================== 19/07/2011 22:18:07 File backed up - wordpress_1311081487_.sql 19/07/2011 22:18:07 File backed up - joomla_1311081487_.sql 19/07/2011 22:18:07 ### Log Ended ============================= 19/07/2011 22:22:37 ### Log Started =========================== 19/07/2011 22:22:37 File backed up - wordpress_1311081757_.sql 19/07/2011 22:22:37 File backed up - joomla_1311081757_.sql 19/07/2011 22:22:37 ### Log Ended ============================= 19/07/2011 22:25:30 ### Log Started =========================== 19/07/2011 22:25:30 File backed up - wordpress_1311081930_.sql 19/07/2011 22:25:30 File backed up - joomla_1311081930_.sql 19/07/2011 22:25:30 ### Log Ended ============================= |
Note: The Log file location UniServer\uni_con\db_backup\db_backup.log
Enable In Cron
Every time you want to create a backup you need to manually run Force DB Backup.
Remembering to manually run scripts like Force DB Backup becomes a chore. Uniform Server centralises running this type of script using portable Cron. Cron is started either manually (portable) or run as a service. It periodically executes a list of scripts; the "Force DB Backup" script is included and requires enabling as follows:
You can open Cron configuration file in one of two ways either using UniController or directely.
UniController: Open file as follows:
Server Configuration > DB Backup > Enable In Cron
Directly: Open the following file in notepad or other suitable text editor:
UniServer\uni_con\cron\cron.ini
Configuration:
|
;[db_backup] ;start = 2009-09-21 2:56:52 ;period = hourly ;path = C:\UniServer\uni_con\db_backup\Run_db_backup.bat ;ref = |
Enable the pre-configured db_backup section in Cron as follows:
|
;[db_backup] start = 2009-09-21 2:56:52 period = hourly path = C:\UniServer\uni_con\db_backup\Run_db_backup.bat ref = |
Note: You can change the start time and period to suit your own requirements. See Cron Configuration file for details.
Select DBs to backup
In order to backup a database it must be added to the backup list contained in a file. This menu option provides an easy to use interface for adding or removing databases to and from this list. All users MySQL databases are listed on the left (1). The list of databases to be backed up is shown on the right (4) these are the current entries saved in a file.
Server Configuration > DB Backup > Select DBs to backup
Add to file
Note: Clear button (3) deselects a selection Remove from file
|
Direct Alternative:
An alternative to using the above menu item is to directly edit the database list file. Open the following file in a text editor:
UniServer\uni_con\db_backup\dbs_to_backup.txt
Add or delete database names as required.
Note: The following files should not be included in the backup list: "information_schema", "mysql", "performance_schema" or "phpmyadmin".
Restore DBs from backup
This menu option allows you to restore a database from a backup file. Note: Smaller number indicates older backup. Server Configuration > DB Backup > Restore DBs from backup Restore database
|
Note: Backup files are saved to folder UniServer\db_backup.