Generate Backup Script
Introduction
SQL application may backup database via Command Line Switches operation. The command line operation may backup all databases or specified database store in DCF file with proper switches.
The command line backup script may generated via context menu command in DCF: Generate Backup Script. The script may execute in console or batch file.
A common usage of backup script is execute the script in Windows Task Scheduler to backup database periodically. This action automate backup operation to ease administrator's task. Tasks added to Task Scheduler starts each time you start Windows, and runs in the background. With Task Scheduler, you can schedule a backup databases task to run daily, weekly, monthly, or at certain times (such as system startup).
This command line backup script is only applicable for Windows 7 & above only.
Generate Backup Script for Database Group
- To generate a backup script for all databases in the selected group:
- Right-click the desired database group and select "Generate Backup Script"

Generate Backup Script for Single Database
- To generate a backup script for a single database:
- Right-click the desired database and select "Generate Backup Script"

Generate Backup Script
- Database (optional): If no database is specified, all databases in the group will be backed up
- Backup to: Select the backup directory
- Admin Password(s): Enter admin user passwords for database access. For multiple databases with different admin passwords, separate passwords with commas. Use the adjacent button to toggle between plain text and masked password display
- Send Mail: Enable to receive backup status notifications via email
- Zip Backup: Enable to compress the backup into a zip file
- Test Email: Click to verify successful email delivery to recipient accounts
- Copy: The command text will be automatically copied to your clipboard for pasting into Windows Task Scheduler (accessible via the "Launch Window Task Scheduler" shortcut)

Email setting for TMNet
- SMTP Host: smtp-proxy.tm.net.my
- SMTP Port No: 25
- SMTP User: n/a. Leave empty
- SMTP Password: n/a. Leave empty
- Use SSL: False (or unticked)
Email setting for Gmail
- SMTP Host: smtp.gmail.com
- SMTP Port No: 465
- SMTP User: e.g.: <your-account>@gmail.com
- SMTP Password: ******* <app password>
- Use SSL: True (or ticked)


Email setting for Yahoo! Mail
- SMTP Host: smtp.mail.yahoo.com
- SMTP Port No: 465
- SMTP User: e.g.: <your-account>@yahoo.com
- SMTP Password: *******
- Use SSL: True (or ticked)
Email setting for private mail server
The following a sample setting. Configure according to your private mail server setting.
- SMTP Host: <your-mail-server>
- SMTP Port No: 587
- SMTP User: e.g.: <your-account>
- SMTP Password: *******
- Use SSL: True or False
Email setting for MSN live mail or Hotmail
Unsupported
Adding Backup Task to Windows Task Scheduler
-
Navigate to Start > Accessories > System Tools > Task Scheduler
-
Click Action > Create Basic Task

-
Enter a name for the task

-
Click Next and select when to trigger the task (e.g., Daily)

-
Click Next, then set the start date, start time, and daily recurrence

-
Click next, choose Start a Program

-
Click next, paste all the backup script text that you copied just now into **"Program/Script"

-
Set the Start in(optional) path to the Exe folder (eg. C:\Estream\SQL Accounting)
-
Click next, a dialog prompted and click Yes

-
Click Next
-
Tick the option Open the Properties dialog for this task when I click Finish

-
Click Finish
-
Select the option Run whether user is logged on or not

-
Click Triggers tab at top then click Edit... button

-
Change the time to run

-
Click OK 2 times

-
Enter the window User Name & Password
-
Click Ok
Recommendations
- Schedule backups during off-hours (e.g., starting at 1:00 AM)
- Do not shut down the server while automatic backups are running
- Consider scheduling server shutdown and startup times for weekends as needed