The procedures in this tutorial are covered in more detail in Pervasive DataExchange User’s Guide.
4 The easiest way to understand the process is to perform an example deployment using the sample database Demodata. The example concentrates on what to do. You can then learn about why you perform certain actions by reading Working with Your Database.The procedures in this section present do not explain why you do things so that you can concentrate on what to do. The intent is to quickly deploy Demodata for replication. After you’ve seen what to do, read the next section, Working with Your Database to understand the why.To do so, in PCC right-click DefaultDB and select Properties. Click the Security tab, select the checkbox Disable database security, and click Apply. If you’re not logged in to DefaultDB, provide the master password. Click OK. Remember to reenable security for DefaultDB after you complete the example deployment.If you want to retain security and deploy Demodata, see Pervasive PSQL Security in Pervasive DataExchange User’s Guide.Before you work through this example, be sure you’ve already installed both a First Site and a Partner Site (backup site) as explained in Installing Pervasive DataExchange:
1
2 Open the XML descriptor file EXPRESS.XML in a text editor.
3 Save EXPRESS.XML as ExampleRTB.xml.You may save the file to the location you choose on your First Site machine. This example uses C:\<Installation Directory >\Replication\Docs.<First
ServerName="db_server1"For First Servername, change DataDirectory="C:\MYDATA"> to DataDirectory="C:\<Installation Directory >\Demodata">.<First
ServerName="db_server1"
DSN="DXDatabase"
DataDirectory="C:\<Installation Directory >\Demodata">The Demodata data files contain a file extension .mkd. Therefore, keep the line <Include Path="*.mkd" />.Because Demodata has data dictionary files (DDFs), keep <Include Path="*.ddf" />. Typically you want to replicate DDFs. Note that the DSN created by DXdeploy does not use Demodata DDFs but uses its own in replication.Change remote.hostname to your site name or IP address. For example, if the Partner Site machine is db_server2:<Partner
ServerName="db_server2"For partner server name, change DataDirectory="C:\MYDATA" /> to DataDirectory="C:\Demodata" />.Note The data directory on the Partner Site could be C:\<Installation Directory >\Demodata if you want to overwrite the sample database. This example uses a different directory to preserve the Demodata sample database as installed by Pervasive PSQL.
2 Press Enter.More detailed messages are written to dxdeploy.log, located in the folder <Installation Directory >\Replication\LogFiles. To view these messages on-screen while DXdeploy runs, you can use the /LOGFILE= option. For example, DXdeploy /Site=First /LOGFILE= ExampleRTB.xml. A space follows the equal sign after LOGFILE=.
1 Start PCC if it is not already running. (Select Control Center & Documentation from the operating system Start menu or Start screen.)
1 From the First Site, copy the file C:\<Installation Directory >\Replication\Docs\ExampleRTB.xml to the same folder on the Partner Site.
3 Copy the contents of the First Site folder C:\<Installation Directory >\Replication\Templates\DXDatabase to C:\Demodata on the Partner Site.Note Demodata files reside in a relative location that can be wherever you choose on the Partner Site. Your application may require absolute paths to certain data files. See File Copying for details.
2 Press Enter.More detailed messages are written to dxdeploy.log, located in the folder <Installation Directory >\Replication\LogFiles. To view these messages on-screen while DXdeploy runs, you can use the /LOGFILE= option. For example, DXdeploy /Site=Partner /LOGFILE= ExampleRTB.xml. A space follows the equal sign after LOGFILE=.
Task 1: Deactivate the example database on both sites
1 On the First Site machine, open a command prompt.
2 Type DXdeact DXDatabase
3 Press Enter.
4 Repeat these steps at a command prompt on the Partner Site.
2 Click Next.
3 In the templates pane, click LOCAL:DXDATABASE.
4 Select Remove DataExchange System Tables and click Yes in the warning message to confirm that you wish to continue.
5 Select Remove DSN and database name.
6 Click Next.
7 Click Close.
1 On the First Site, find the DX_projectname directory under C:\<Installation Directory >\Demodata that was created during deployment.DX_projectname is the name given to your replication project in the XML deployment file, in this case DXProj in the following line in ExampleRTB.xml:
2 Delete the folder \<Installation Directory >\Demodata\DX_DXProj.
3
1 On the Partner Site, start PCC if it is not already running. (Select Control Center & Documentation from the operating system Start menu or Start screen.)
2
3 Click Yes.
4 Verify that DXDatabase is the database name selected.
5 For the option Always remove associated DSN entries, do one of the following:
6 Click OK.
7 To complete removal of the deployed replication database on the Partner Site, delete the directory C:\Demodata. This was the directory created in Task 4: Copy the Template to the Partner Site.
4 Determine which tables need to be replicated. Consider any situations in which tables created dynamically also need to be replicated. See Adding Dynamic Tables to an Activated Database, in Pervasive DataExchange User’s Guide.You specify the tables to be replicated in the XML deployment descriptor file. See XML Deployment Descriptor File.Among other information, the statistics output informs you about system data and key. If the output shows that System Data = Yes and SYSKEY Status = Present, then system data and key is present.If the existing database does not have system keys, you must add system data and keys with the Pervasive PSQL Rebuild utility. Refer to the Rebuild Utility chapter in the Pervasive PSQL Advanced Operations Guide.Pervasive PSQL provides security models for Btrieve applications. However, the activated databases created by DXdeploy do not contain security, even if the source database does. You may add security to a replication database if you choose. See Pervasive PSQL Security in Pervasive DataExchange User’s Guide. For more details, see also the chapter on Pervasive PSQL Security in the Pervasive PSQL Advanced Operations Guide.The XML deployment descriptor file is a text file in which you specify information for the DXdeploy utility. For real-time backup between two machines, you use the descriptor file EXPRESS.XML. This file is located in the \<Installation Directory >\Replication\Docs folder.You must edit the XML file for your situation. The following table explains the attributes in the XML file that may require editing. The default value for some of the attributes may be adequate as is. With the exception of Exclude Path, DXdeploy requires all of the attributes. DXdeploy is further discussed in Pervasive DataExchange User’s Guide. See dxdeploy.
Project often corresponds to a specific database. If your goal is to replicate a database named mydatabase, then you may want to call the project mydatabase project or something similar that helps you remember which database is involved.
• Relative paths are relative to DataDirectory listed in the <Sites> section of the XML file.
• This attribute specifies the root for relative paths in Include Path and Exclude Path. DataDirectory must begin with a drive letter.DataDirectory in First Servername applies to the First Site. DataDirectory in Partner Servername applies to the Partner Site. After you edit the XML descriptor file, you run the DXdeploy utility on the First Site. The utility creates a template of the source data files. (Hereafter, for ease of discussion, the source data files will be referred to collectively as the source database.)You use a template to activate a database. Activation is the process of enabling a database for replication and establishing it as belonging to a site. DXdeploy also activates the source database on the First Site.
An activated database is placed in a folder named DX_projectname, which is subordinate to the source database folder. All templates are placed in the <Installation Directory >\Replication\Templates folder.
• <Installation Directory >\Replication\Templates\
mydbdsn — This folder contains the empty data files produced from the source data files. The empty files are considered part of the template. Also in this folder is a copy of the XML descriptor file.
• <Installation Directory >\Replication\Templates\
mydbdsn\DX_myproject — This folder contains the remaining replication-enabled files, such as the control tables.
DX_projectname subdirectory:
<Installation Directory >
Replication
Templates
mydbdsn
mydatabase
DX_projectname After the template is copied to the Partner Site and DXdeploy activates it on the First Site, activate the Partner Site. Run DXdeploy with the same XML deployment descriptor file used for the First Site. The edited file is found in the database directory under <Installation Directory >\Replication\Templates, which in the example above would be \<Installation Directory >\Replication\Templates\mydbdsn\mydatabase.Following deployment, you may want to set up a replication schedule to initiate replication. A replication schedule periodically keeps the Partner Site data concurrent with the First Site data. See Schedule Tasks in Pervasive DataExchange User’s Guide for how to set up a replication schedule.