Create a Back Up of the Assured PackOut Database Assured PackOut does not contain an inherent back-up utility by default; therefore, it is recommended as a best practice to investigate options for setting up a back-up process to secure your PackOut database. Below are three options for administering a back-up system for the PackOut: 1. Back up programs such as BackUp Exec with SQL agents 2. Free utilities specifically SQL BackupAndFTP that are available on-line 3. Using SQL Server Management Studio and Windows Task Scheduler to automate the backup Back Up Programs: Paid programs such as Backup Exec with the appropriate SQL Server Agent make regular backups very simple. The interfaces are intuitive, and you would simply configure to back-up the following: SQLEXPRESS_ASL\AssuredPackOut is the instance\database that would need to be backed up. The ATTACHMENTS folder should also be backed up the default location for this file is: C:\ProgramData\Assured Software\Assured PackOut\Attachments A daily backup of these files and a tape rotation system are recommended. Free Back Up Utilities: One very reliable and simple back up program available for free is SQLBackupAndFTP created by Pranas.net. The program can be downloaded from: http://sqlbackupandftp.com/ Please note, although we have tested and verified its functionality with the 8.0.4 version, Assured Software cannot be responsible to offer support for the use of this utility. Once downloaded and installed, the program is very simple to configure. 1) Connect to the SQL Server. Click the "Connect to SQL Server" button, the Connect form will open. Server Name: Enter the name of SQL server you are connecting to (if you are on the server this would likely look like.\sqlexpress_asl). Click "Test Connection" to verify the connection. If the connection fails, first use SQL Server Management Studio (SSMS) to connect to your database then use exactly the same settings in SQLBackupAndFTP. Assured PackOut Tutorial Page 1 of 5
2) Select AssuredPackOut Database 3) Select where to store the back ups Click Add backup destination. Select the option which works best for the current environment and infrastructure, the most common choice will be Local or Network folder. i. Local/Network Folder ii. FTP Server iii. Dropbox iv. Google Drive v. Amazon S3 The backup must either be stored on a different physical drive than where the PackOut database resides or on another computer. Choose the target folder: ex. \\backupserver\packoutbackups\ or D:\ PackOutBackups. Note: The account that starts a scheduled job must have sufficient rights to write to the target folder. 4) Attachments Ensure that the Attachments folder is also being backed up. The default location of this folder is: C:\ProgramData\Assured Software\Assured PackOut\Attachments Assured PackOut Tutorial Page 2 of 5
5) Schedule the Back Up Job. Select "Schedule this job" - Select a time to do the full backup (usually during the night). Press the Save button on the toolbar and name the job appropriately. The backup job can be set Differential and Transaction log backups in "Advanced Schedule". You can also schedule the job to run on a custom schedule (more often than once daily). At this point, you can then decide to copy the backup files to an external hard drive or removable memory device for an additional level of security. Manual Back-Up Procedure SQL Server Management Studio: Step 1: Create Back Up Folders In Windows Explorer, create three folders: C:\BackupPackout C:\ BackupPackout\scripts C:\BackupPackout_Del this folder will store older backup files These folder names and drive letters are just a suggestion, but will be utilized throughout the following steps. Other names and locations can be used, just modify the following steps accordingly to reflect those differences. Step 2: Create the Scripts Create a script in SQL Server Management Studio for Microsoft SQL Server 2008 R2: 1) Ensure that the server name and instance are correct SERVERNAME\SQLEXPRESS_ASL. 2) Click Connect. 3) To ensure connection to the correct instance, expand Database and verify AssuredPackOut exists as a database. 4) Click New Query. 5) Copy and Paste the following query into the query window: DECLARE @Path NVARCHAR(1000), @FileName NVARCHAR(255), @FullPath NVARCHAR(1255) SET @Path = 'C:\BackupPackout\' SET @FileName = 'PackOut_' + REPLACE(CONVERT(VARCHAR(10), GETDATE(), 101), '/', '') + '.bak' SET @FullPath = @Path + @FileName BACKUP DATABASE AssuredPackOut TO DISK = @FullPath WITH INIT Assured PackOut Tutorial Page 3 of 5
6) Save the script: File Save SQLQuery As: Browse to C:\BackupPackout\scripts Save query as backupdb.sql Click Save Step 3: Batch File The batch file makes use of a Microsoft utility called Robocopy. Robocopy (the name is short for Robust File Copy) was introduced with the Windows Server 2003 Resource Kit and is included in all editions of Windows 7, 8 and later server versions. Robocopy, if not already installed, can be downloaded from the Microsoft web site. NOTE: The INSTANCENAME needs to be edited with the appropriate server and instance name. 1) Open Notepad, copy and paste the following: REM Run SQL Script to backup database sqlcmd -S INSTANCENAME -E -i "C:\ BackupPackout \scripts\backupdb.sql" REM Remove files older than 7 days robocopy C:\SQLServerBackups C:\ BackupPackout_Del /MOV /MINAGE:7 /R:10 del C:\SQLServerBackupsDel /q /s INSTANCENAME = SERVERNAME\SQL_INSTANCE i.e. SERVER\SQLEXPRESS_ASL 2) Save the file as BackupScript.cmd, in the C:\BackupPackout directory Step 4: Automate the Scripts Once the script and batch file are created they need to be executed on a regular basis so that the PackOut database is backed up automatically. To do this, open Task Scheduler: Start All Programs Accessories System Tools 1) From the right hand Action menu bar select Create Basic Task. The scheduling Wizard should now be displayed where you can set up the task. 2) Give the task a meaningful name ex. Backup_PackOut, click Next. NOTE: These steps may be a little different depending on your operating system. 3) Now specify how often you want to run the task (daily would be recommended). 4) Select the start time, click Next. 5) When asked What action do you want the task to perform, ensure Start a program is selected. 6) Click Browse, and locate the newly created BackupScript.cmd. 7) Click Open, and then Next. 8) Review the Task settings, and click Finish. Assured PackOut Tutorial Page 4 of 5
Step 5: Perform the Back Up It is recommended that the script is tested to ensure that the backup has been configured correctly: 1) Open Task Scheduler. 2) Select Task Scheduler Library (left hand pane). 3) Select PackOut_Backup. 4) Right click, and select Run. 5) It may take a minute or so to create the.bak file depending on database size. 6) Open Windows Explorer, browse to C:\BackupPackout. 7) If configured correctly, a.bak file will have been created with a name similar to PackOut_08082012.bak (the numbers reference the date which the file was created). 8) If this file does not exist, please verify that following are accurate: Directory paths SQL Server Instance Path sql query and.cmd file are in the correct locations Ensure that the program being utilized for network backups is configured to back up the newly created Backups folder. Once correctly configured, a daily.bak file will be created in the BackupPackOut folder with the creation date appended to the database name (i.e. PackOut_08092013.bak). As the script is written above, any.bak file older than 7 days will be transferred to the BackUpPackOut_del folder. The contents of the BackUpPackOut folder can then be copied to an external location for an additional measure of security. Step 6: Remember Attachments Ensure that the Attachments folder is also being backed up. The default location of this folder depends on the operating system: Windows XP / Server 2003: C:\Documents and Settings\All Users\Application Data\ Assured PackOut Windows Vista, 7&8 / Server 2008 and newer: C:\ProgramData\Assured Software\Assured PackOut NOTE: The Program Data is typically a hidden directory. Ensure you are able to view Hidden Files in your folder options. Assured PackOut Tutorial Page 5 of 5