Database Management


In this chapter, you will find a description of the role of the VPT database, and procedures for manually backing up and restoring the database.

See the following sections:

VPT Database Design

Backing Up the VPT Database

Restoring the VPT Database

VPT Database Design

The VPT database contains data that the VPT application uses to facilitate provisioning of product systems—details about the product systems and how to communicate with them; information about administrator accounts, roles, and permissions; security settings; and the templates that are used in provisioning users and phones. The VPT database does not store data that is related to individual users and phones—this data resides in the databases of the individual product systems to which the users and phones have been added.

To maintain the data that the tool requires in the event of a loss of system functionality that requires reinstalling the application, you should back up the database on a regular basis. If such an outage occurs, you can reinstall VPT and then restore the database to regain functionality. You can perform both the backup and restore operations by using standard SQL tools.

Backing Up the VPT Database

Run the following procedure on the VPT server to back up the VPT database to a file.

To Back Up the VPT Database


Step 1 On the VPT server, on the Windows Start menu, choose Programs > Accessories > Command Prompt.

Step 2 In the Command Prompt window, enter
osql -S localhost -E -Q "backup database usadb to disk='<File Name>' with init"
and press Enter.


Note The file name must end with the extension .dat.


Step 3 When the backup is complete, close the Command Prompt window.


Tip You can use the Windows AT command in conjunction with the osql command in Step 2 to schedule a periodic backup of the database. For help with the AT command, enter AT /? in a Command Prompt window.



Restoring the VPT Database

You can restore the VPT database from a file if you have removed the VPT database during an uninstall operation or if you otherwise need to recapture the data. Use one of the following procedures, as applicable to your situation:

If the location where MSDE/SQL Server is installed has not changed since the backup was made, see the "To Restore the Database to the Same MSDE Location" procedure.

If the location where MSDE/SQL Server is installed has changed since the backup was made (for example, if you have uninstalled and reinstalled VPT, specifying a different install directory each time), see the "To Restore the Database to a Different MSDE Location" procedure.

To Restore the Database to the Same MSDE Location


Step 1 Ensure that the VPT Tomcat service is stopped.

a. On the VPT server, on the Windows Start menu, choose Programs > Administrative Tools > Services.

b. In the right pane, locate VPT Tomcat, right-click it, and click Stop.

Step 2 On the Windows Start menu, choose Programs > Accessories > Command Prompt.

Step 3 In the Command Prompt window, enter
osql -S localhost -E -Q "restore database usadb from disk = `<File Name>'"
and press Enter.

Step 4 Close the Command Prompt window.

Step 5 Start the VPT Tomcat service.

a. On the Windows Start menu, choose Programs > Administrative Tools > Services.

b. In the right pane, locate VPT Tomcat, right-click it, and click Start.


To Restore the Database to a Different MSDE Location


Step 1 Ensure that the VPT Tomcat service is stopped.

a. On the VPT server, on the Windows Start menu, choose Programs > Administrative Tools > Services.

b. In the right pane, locate VPT Tomcat, right-click it, and click Stop.

Step 2 On the Windows Start menu, choose Programs > Accessories > Command Prompt.

Step 3 In the Command Prompt window, enter
osql -S localhost -E -Q "restore database usadb from disk = `<File Name>' with move 'usadb' to '<New Path>\MSSQL\Data\usadb.mdf', move 'usadb_log' to '<New Path>\MSSQL\Data\usadb_log.LDF'"
and press Enter.


Note Make sure that the new path that you enter in this command contains the MSSQL\Data directory.


Step 4 Close the Command Prompt window.

Step 5 Start the VPT Tomcat service.

a. On the Windows Start menu, choose Programs > Administrative Tools > Services.

b. In the right pane, locate VPT Tomcat, right-click it, and click Start.