This article explains how to correct backup paths in SQL scripts, update the backup batch file, and configure Windows Task Scheduler for reliable full and log backups.
Follow each section in order, test, then monitor the logs to confirm success. :contentReference[oaicite:0]{index=0}
Preparation
- Confirm you have admin rights on the application server and SQL Server instance.
- Create or verify that the target backup folders exist on disk and have sufficient free space, for example, F:\GP_Backups\Full\ and F:\GP_Backups\Logs\.
- Identify the scheduled task account and ensure it has permissions to read SQL scripts, execute the batch file, and write to the backup and log folders.
Correct the backup path in SQL scripts
- Navigate to the intended backup destination folder in File Explorer. Copy the full path.
- Open each SQL backup script in your editor. Locate the current backup path string.
- Replace the old path with the correct path between single quotes, for example, 'F:\GP_Backups\Full\'.
- Ensure the path ends with a trailing backslash \ before saving the script.
- Repeat for all database scripts, including Docs, Core, and Transaction Log variants as applicable.
Edit the backup batch file
- Right-click the batch file and select Edit.
- Update the Backup Source File variable so it points to the folder where the scheduled backup SQL scripts are stored on disk.
- Set the BackupServer variable to the SQL Server instance name that hosts the GhostPractice databases. In SQL Server Management Studio, copy the exact Server Name and paste it into the batch file.
- Verify the BackupLogs folder path in the batch file. Confirm the log filenames referenced by the script match the actual files present in the log folder.
- Save the batch file and close the editor.
Create a scheduled task for full backups
- Open Task Scheduler and select Create Task.
- General tab: set a clear task name that others can recognise during troubleshooting. Select Run whether the user is logged on or not. Tick Run with highest privileges.
- Triggers tab:
- Click New.
- Begin the task on a schedule.
- Set daily at 10:00 PM, and ensure the trigger is enabled.
- Click OK.
- Actions tab:
- Click New.
- Action Start a program.
- Browse to and select the backup batch file on disk.
- Click OK.
- Conditions tab (optional):
- Tick Wake the computer to run this task if required.
- When prompted, enter the password for the selected run account so the task can execute unattended.
Create a scheduled task for log backups
- Repeat the steps from the full backup task to create a separate task for transaction log backups.
- In Triggers, set a schedule suitable for your recovery objectives, for example, every 30 minutes during business hours. Ensure the trigger is enabled.
- Point the Action to the correct batch file or parameters that execute the log backup scripts.
Verify backups and logs
- Manually run the full backup task once. Confirm completion without errors.
- Check the destination folder for newly created .bak or .trn files as expected.
- Open the BackupLogs folder and review the latest log file entries for success messages and timestamps.
Common issues and fixes
- Wrong path in SQL scripts: ensure the path is wrapped in single quotes and ends with a backslash.
- Batch file variables not aligned: verify Backup Source File, BackupServer, and log paths match your environment.
- Task runs but no files created: confirm the run account has NTFS write permissions on the backup and log folders and has rights in SQL Server to execute the scripts.
- Task disabled or not firing: open Triggers and confirm the schedule is enabled and in the correct time zone for the server.
Conclusion
With correct paths in SQL scripts, a properly configured batch file, and reliable Task Scheduler entries for full and log backups, GhostPractice backups will run consistently. Monitor the log files after each change and adjust schedules or permissions as your practice requirements evolve.