In this section:
Starting with DTP 2022.2, DTP no longer ships with an embedded database and the features described on this page are deprecated. Legacy users who wish to transition to using an external database should see Migrating an Embedded Database to an External Database.
Backing Up the Embedded Database for Windows
The following instructions describe how to back up the DTP database within the embedded database server to MySQL script files.
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Start the Parasoft Database Service Windows service.
- Run the Windows batch file at <DTP_HOME>/bin/db_backup.cmd with the backup argument.
Example: C:\Program Files\Parasoft\DTP\bin\db_backup.cmd backup
The batch file generates an SQL file called dtpDbBackup_<TIMESTAMP>.sql.
Restoring the Embedded Database for Windows
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Start the Parasoft Database Service Windows service.
- Open a command prompt and run the db_backup.cmd Windows batch file located in the <DTP_HOME>/bin/ directory with the
restore
command and-d <SQL FILE>
argument to restore the DTP database from the back up SQL file. Example:
C:\Program Files\Parasoft\DTP\bin\db_backup.cmd restore -d "C:\DTP-Backup.sql"
Backing Up the Embedded Database for Linux
You can use one of the following methods to back up database.
Method 1: Using the DTP Console
- Run <DTP_HOME>/bin/dtpconsole.sh to open the DTP console
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Choose the Database (Embedded)
- Choose the Start option to start the Database (Embedded) service
- Choose the Backup option to begin creating the database backups
Method 2: Running the Back Up Script
- Run <DTP_HOME>/bin/dtpconsole.sh to open the DTP console.
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Exit the console and run the <DTP_HOME>/bin/db_backup_run.sh script file with the backup argument.
Both methods generate a dtpDbBackup_<TIMESTAMP>.sql file.
Restoring the Embedded Database for Linux
You can use of the following methods to restore the database.
Method 1: Using the DTP Console
- Run <DTP_HOME>/bin/dtpconsole.sh to open the DTP console.
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Choose the Database (Embedded).
- Choose the Start option to start the Database (Embedded) service.
- Choose the Restore DB option.
- Enter the DTP backup file path as requested. You can also leave the entry empty and press ENTER to skip this step.
Method 2: Running the Back Up Script
- Run <DTP_HOME>/bin/dtpconsole.sh to open the DTP console.
- Stop Parasoft DTP Server and Data Collector services, see Stopping DTP Services.
- Exit the console and run the <DTP_HOME>/bin/db_backup_run.sh script file with the
restore
command and-d <SQL FILE>
argument to restores the DTP database from the SQL file. Example:
/home/tester/dtp/db/bin/db_backup_run.sh restore -d "/home/tester/DTP-Backup.sql"
Migrating the Embedded Database to an External Database Server
If you have used DTP's embedded database and would like to switch over to an external database while preserving your current data, you can do so in a few easy steps. Your new, external database must be compatible with DTP's embedded database (see Requirements and Support for more information about supported databases) and, as a best practice, it is recommended that the external database be installed on a different machine than DTP.
- Stop all DTP services that are using the DTP Console. See Stopping DTP Services for more information.
- Back up the embedded database. See Backing Up the Embedded Database for more information.
- Install a MySQL database to use as the external database. To ensure compatibility with the embedded database, use the latest version of MySQL 5.7.
- Be sure to set up a root account, which you will need for the next step.
- It is recommended that you install your database on a different machine than DTP.
Create the DTP database, "dtp" user, and schema using a root account for the new external database.
mysql -u root -p < <DTP_HOME>/grs/db/dtp/mysql/create.sql
When the process finishes, import the data from the embedded database backed up in Step 2 using the new "dtp" user. The default password for the "dtp" user is
U%Cew2d6
.mysql -u dtp -p DTP < <DTP_DATA>/db/backup/dtpDbExport_<TIMESTAMP>.sql
Download the MySQL JDBC driver for your external database's version of MySQL and save it in the
<DTP_DATA>/lib/thirdparty
directory. It is recommended that you use the latest version of MySQL Java Connector.- Edit the
<DTP_DATA>/conf/PSTRootConfig.xml
with the following changes:Set "embedded-db enabled" to
false
.<embedded-db enabled="false"/>
Set the "url" value under "dtp-db-connection" to the URL, with both host and port, where the MySQL service is running.
<dtp-db-connection> ... <url>jdbc:mysql://<HOST>:<PORT>/DTP</url> </dtp-db-connection>
- In the DTP console, restart the DTP Server service and all other necessary services (for example, Data Collector and/or DTP Enterprise Pack). Do not restart the Embedded Database service.
- Once the DTP Server service is running again, log into DTP and verify DTP is working and that all data has persisted.