Application Note - JDSU PathTrak Video Monitoring System Data Backup and Restore Process This Application Note provides instructions on how to backup and restore JDSU PathTrak Video Monitoring data. Automated backups are possible using the Task Scheduler service built-in to Microsoft Windows. There is an option to perform backups without the need to stop the services. Q. How do I backup JDSU PathTrak Video Monitoring data? A script named backup.bat is provided in the bin folder of the PathTrakVM installation folder on your server. Use this regularly to keep your backups current. NOTE: The placement of the PathTrakVM installation folder was determined when the JDSU PathTrak Video By default, the usage of this script will retain up to seven complete JDSU PathTrak Video Monitoring data backups. After that, the oldest backup will be overwritten upon performing the next backup. The backups are placed into folders named backup_1 through backup_7. These backup folders are contained within a subdirectory named backups located under the PathTrakVM installation folder on your server. To manually run the backup script: 2. Type the following command followed by Enter: backup 3. Wait for the backup script to complete. Depending upon the size of your database, the backup script can take up to several minutes to complete. During this time, the PathTrakVM, Tomcat, and MySQL services will not be available. IMPORTANT: The PathTrakVM, Tomcat, and MySQL services will be stopped while the backup script is running and will restart when the backup is complete. Probes cannot synchronize measurement data and users cannot access the JDSU PathTrak Video Monitoring web application or client while these services are stopped. NOTE: A log file of the most recent backup can be found in the log folder in your PathTrakVM installation folder on your server (or in the same folder of the backup script if the log folder does not exist). A copy of the log is also placed in each backup folder. Q. Can I backup JDSU PathTrak Video Monitoring data without stopping services? It is possible to have the backup script run without stopping the PathTrakVM, Tomcat, and MySQL services. Instead of making a copy of all the database files, this option creates a.sql file that can be used to restore the MySQL database. However, this method can take longer depending upon the size of your database. To manually run the backup script without stopping the PathTrakVM, Tomcat, and MySQL services: 2. Type the following command followed by Enter: backup l 3. Wait for the backup script to complete. NOTE: To find out what all the options for the backup.bat script are, type the following command followed by Enter: backup? Q. How can I specify where the backup folders are placed? You can use the -r option to specify the root directory path for your backup folders. If the path contains spaces, you must put quotation marks around it. You must put a space between the -r and the root path when entering the command. Q. How can I specify how many backups I want to retain?
You can use the -n option to specify the maximum number of backup folders to retain. Once this number of backup folders is created, the oldest backup folder will be overwritten upon performing the next backup. You must put a space between the -n and the maximum number of backup folders when entering the command. Q. Can I use a timestamp for the backup folder names instead of numbering them? You can use n dt to specify that you want to timestamp the backup folder names instead of numbering them. The format of the folder name is backup_yymmdd_hhmmss. If you do this keep in mind there will be no limit to the number of backup folders retained. Q. How do I restore JDSU PathTrak Video Monitoring data? The restoration process depends upon the method used to create the backup. The two methods are: A) Backup was created with services stopped and B) Backup was created without services stopped. NOTE: You can determine which method was used to create the backup by reading the log file located in the backup folder that you are going to restore from. If services were stopped during the backup, this will appear in the log. IMPORTANT: The PathTrakVM server version from which the backup was created must match the PathTrakVM server version of the current installation. A) Restoring data when the backup was created WITH services stopped: 1) Locate the desired backup folder that you want to restore the data from. Notice the various subdirectories that were saved during the backup. You will be restoring these files. IMPORTANT: DO NOT accidentally delete these files during following steps. 2) Shutdown the PathTrakVM, Tomcat and MySQL services: IMPORTANT: Probes cannot synchronize measurement data and users cannot access the JDSU PathTrak Video Monitoring web application or client while services are shutdown. b) Select PathTrakVMService and press the stop icon (the Apache Tomcat service will also automatically stop). c) Select MySQL and press the stop icon. 3) Restore the..\mysql Server 5.1\data folder a) Locate and DELETE the data folder from the MySQL Server 5.1 folder. NOTE: The placement of the MySQL Server 5.1 folder was determined when the JDSU PathTrak Video Monitoring server was installed. It is typically located at: C:\Program Files\MySQL\MySQL Server 5.1 b) Locate the \mysql\data folder in the backup folder from which you are restoring from and COPY it from the backup folder into the MySQL Server 5.1 folder. 4) Restore the..\mysql Server 5.1\my.ini file a) Locate the \mysql\my.ini file in the backup folder from which you are restoring from. b) COPY the \mysql\my.ini file from the backup folder into the MySQL Server 5.1 folder. You will need to overwrite the existing my.ini file. 5) Restore the..\pathtrakvm\cfg folder: a) Locate and DELETE the cfg folder from the PathTrakVM folder. NOTE: The placement of the PathTrakVM folder was determined when the JDSU PathTrak Video b) Locate the \PathTrakVM\cfg folder in the backup folder from which you are restoring from and COPY it from the backup folder into the PathTrakVM folder. 6) Restore the..\tomcat 6.0 folders: a) Locate and OPEN the tomcat folder in the backup folder from which you are restoring from.
b) Locate the Tomcat 6.0 folder on your server. NOTE: The placement of the Tomcat 6.0 folder was determined when the JDSU PathTrak Video Monitoring server was installed. It is typically located at: c:\program Files\Apache Software Foundation\Tomcat 6.0 c) COPY any folders found within this backup tomcat folder to the Tomcat 6.0 folder on your server. You may need to overwrite existing folders. 7) Restart the services: b) Select MySQL and press the start icon. c) Select PathTrakVMService and press the start icon (the Apache Tomcat service will also automatically start). B) Restoring data when the backup was created WITHOUT services stopped: 1) Locate the desired backup folder that you want to restore the data from. Notice the various subdirectories that were saved during the backup. You will be restoring these folders. IMPORTANT: DO NOT accidentally delete these folders during following steps. 2) Shutdown the PathTrakVM, Tomcat and MySQL services: IMPORTANT: Probes cannot synchronize measurement data and users cannot access the JDSU PathTrak Video Monitoring web application or client while services are shutdown. b) Select PathTrakVMService and press the stop icon (the Apache Tomcat service will also automatically stop). c) Select MySQL and press the stop icon. 3) Restore the..\mysql Server 5.1\my.ini file a) Locate the \mysql\my.ini file in the backup folder from which you are restoring from. b) COPY the \mysql\my.ini file from the backup folder into the MySQL Server 5.1 folder. You may need to overwrite the existing my.ini file 4) Restart the MySQL service: b) Select MySQL and press the start icon. 5) Restore the MySQL database: a) Locate the \mysql\pathtrakvmdb.sql file in the backup folder from which you are restoring from. b) Open a Command Prompt and navigate to the bin folder in the MySQL Server 5.1 folder. NOTE: The placement of the MySQL Server 5.1 folder was determined when the JDSU PathTrak Video Monitoring server was installed. It is typically located at: C:\Program Files\MySQL\MySQL Server 5.1 c) Type the following command followed by Enter: mysql uroot < FILE_PATH\pathtrakvmdb.sql Where FILE_PATH is the full path to the folder that contains the pathtrakvmdb.sql file which you located in step a. EXAMPLE: mysql -u root pathtrakvmdb < "C:\Program Files\PathTrakVM\backups\backup_2\mysql\pathtrakvmdb.sql" d) Wait for the MySQL database restore process to complete. 6) Restore the..\pathtrakvm\cfg folder:
a) Locate and DELETE the cfg folder from the PathTrakVM folder. NOTE: The placement of the PathTrakVM folder was determined when the JDSU PathTrak Video b) Locate the \PathTrakVM\cfg folder in the backup folder from which you are restoring from and COPY it from the backup folder into the PathTrakVM folder. 7) Restore the..\tomcat 6.0 folders: a) Locate and OPEN the tomcat folder in the backup folder from which you are restoring from. b) Locate the Tomcat 6.0 folder on your server. NOTE: The placement of the Tomcat 6.0 folder was determined when the JDSU PathTrak Video Monitoring server was installed. It is typically located at: c:\program Files\Apache Software Foundation\Tomcat 6.0 c) COPY any folders found within this backup tomcat folder to the Tomcat 6.0 folder on your server. You may need to overwrite existing folders. 8) Restart the services: b) Select PathTrakVMService and press the start icon (the Apache Tomcat service will also automatically start). Q. How can I automate the process of backing up JDSU PathTrak Video Monitoring data? You can use the built-in Microsoft Windows Task Scheduler service to perform backups automatically. A script named backuptask.bat is provided in the bin folder of the PathTrakVM installation folder located on your server. This script will create a scheduled task for you that will automatically backup your JDSU PathTrak Video Monitoring data on a daily basis. NOTE: The placement of the PathTrakVM installation folder was determined when the JDSU PathTrak Video This script will create a scheduled task that will perform backups with the following characteristics: The backup will occur daily at 01:00 (1 AM) A maximum of seven backup folders will be retained. After that, the oldest folder will be overwritten upon the next backup. The backup folders will be named backup_1 through backup_7 and will be located within a subdirectory named backups under your PathTrakVM server installation folder. PathTrakVM, Tomcat, and MySQL services will be stopped for the duration of the backup process. IMPORTANT: The PathTrakVM, Tomcat, and MySQL services will be stopped while the backup script is running and will restart when the backup is complete. Probes cannot synchronize measurement data and users cannot access the JDSU PathTrak Video Monitoring web application or client while these services are stopped. NOTE: You can use Windows Scheduled Tasks as explained in another section of this Application Note to modify the configuration of the automated backup task. To create a new scheduled task that will perform daily backups: 2. Type the following command followed by Enter: backuptask 3. Enter your logon password when prompted. IMPORTANT: The user account that you logon with must have the necessary privileges to run the task. 4. Wait for the backup script to complete. NOTE: If the Windows Task Scheduler service is not running, the script will start it for you.
To delete a previously created backup scheduled task: 2. Type the following command followed by Enter: backuptask -d 3. Type Y when prompted to delete the task. 4. Wait for the backup script to complete. Q. Can I create a scheduled task without using the provided script? You can use Microsoft Windows Scheduled Tasks to create your own backup task. 1. Open the Control Panel window and double click the Scheduled Tasks icon. 2. From the Scheduled Tasks window double click Add Scheduled Task to start the Scheduled Tasks Wizard and then click the Next button. 3. On the next page of the wizard, click the Browse... button and use the Select Program to Schedule dialog to navigate to a script named backup.bat located in the bin folder of PathTrakVM installation folder on your server. Click the Open button. NOTE: The placement of the PathTrakVM installation folder was determined when the JDSU PathTrak Video 4. Upon returning to the Scheduled Tasks Wizard, type a name for the scheduled task you are creating. A suggestion for this name is PathTrakVM Backup. Then select when you want the backup task to be performed by clicking on the appropriate radio button. Click the Next button. 5. Enter the desired time of day when you want the backup performed and click the Next button. 6. Enter your user name and password as needed and click the Next button. IMPORTANT: The user account that you logon with must have the necessary privileges to run the task. 7. On the next page of the wizard, verify that the task is configured correctly. If necessary, click the Back button to make changes. Otherwise, click the Finish button. Q. I ve created a backup scheduled task. How can I configure it to run when and how I want it to? After you ve created a scheduled task either using the script provided or manually by yourself, you can edit it using Microsoft Windows Scheduled Tasks. 1. Open the Control Panel window and double click the Scheduled Tasks icon. 2. Locate the backup task in the list on Scheduled Tasks window. It will be named PathTrakVM Backup if you used the provided script to create the task. 3. Double click the backup task to open its Properties window.
From the Properties window of the backup scheduled task you can configure various settings including the start time and how frequently the backup is performed. You can also use the batch file command line options to configure how the backup script is executed as described in other sections of this Application Note. You enter these options in the Run edit box on the Task tab of the Properties window. For example, if you want to run the script so that it will retain a maximum of 30 backup folders and will not stop services while performing the backup, you would enter the n 30 l options in the Run edit box as shown below: IMPORTANT: Command line options must be typed outside the quotation marks that contain the path to the backup script. You can enter any of the options described in the usage below: ------------------------------------------------------------------------------- USAGE: backup [-r dir] [-n cnt] [-l] -r = root directory path for backup folders (this path must include a drive letter and must not be relative) -n = maximum number of backup folders to retain (0-365) -l = perform backup without stopping services (using this option creates a.sql file for restoring the database) -------------------------------------------------------------------------------