Data Synchronization Deployment Models

Data Synchronization Deployment Models
A Look at Deployment Models Available for Data Synchronization
This chapter explains conceptual information pertaining to the various deployment methods and options available in Data Synchronization. This chapter also provides step-by-step instructions for each available method.
This chapter includes the following sections:
*
*
*
*
*
*
Data Synchronization Deployment Methods
Data Synchronization offers two methods for deploying replication, depending on database properties and business needs. The methods are 1-way and 2-way.
To determine the best deployment method, see the following table. It lists database properties and the best deployment method to meet those needs. So, if your database contains the properties listed in the first column, select the corresponding deployment method in the second column.
DataExchange Implementation Options
The Deployment Wizard and DXDeploy Utility are implementation options for the deployment methods.
DataExchange Deployment Wizard
The DataExchange Deployment Wizard is used to implement 1-way and 2-way deployment methods. It walks you through entry of necessary information to deploy a replication database and, if desired, create a replication schedule. The wizard creates a deployment bundle when you deploy at the First Site. This bundle is then used at the Partner Sites to complete the deployment. The wizard automates designing a replication template, activating the database for replication, synchronizing tables, performing an initial replication, and setting a replication schedule.
See dpwizard for more information on the DataExchange Deployment Wizard included in this release.
DataExchange DXDeploy Utility
The DataExchange DXDeploy utility can be used to implement 1‑way and 2-way deployment methods. This command-line utility reads information from an XML descriptor file that you create to include specific information about your database and replication environment. You then include this file as an argument when you execute the utility. DXDeploy uses the XML descriptor file to design a replication template, activate the database for replication, synchronize tables, and perform an initial replication.
DataExchange includes two different XML descriptor templates you can use to create your specific XML descriptor file to use with DXDeploy. You must edit the template to include necessary information in order for DXDeploy to successfully replicate your data; you cannot use the template file as-is and successfully replicate your data. See dxdeploy for more information on the XML descriptor templates included in this release and how they are used with DXDeploy.
Where To Go From Here
By now, you should have a good idea as to the deployment method and implementation option that is right for you. The sections that follow provide step-by-step instructions for each of the deployment methods and implementation options currently available.
The next table lists each deployment method and implementation option described in this chapter and lists where to find specific instructions for implementing each specific scenario.
 
Working with the Examples
This section leads you through a number of useful examples of deployment methods. The steps you need to perform depend on how your database was deployed. The first set of instructions describes steps required for deployments performed using DXDeploy.
Tip When working with the examples in this chapter, you should always make a copy of your database before performing the steps, so that you can restore the original database when you are done. In addition, you do not need to retain the example deployed database when you are finished. After each deployment, you will need to perform the steps associated with your deployment method to remove the replication files and templates and restore your database. The following examples explain how to remove an already deployed database from the First Site and the Partner Site.
Removing Databases Deployed with DXDeploy
Use these tasks to remove a database deployed using DXDeploy:
1
2
3
4
5
Deactivate the Example Database on Both Sites
*
1
On the First Site machine, open a command prompt.
2
DXdeact DXDatabase
The command is case-insensitive.
3
Press Enter.
When the prompt reappears, the example database on the First Site is deactivated.
4
Run Template Remover on the First Site
*
1
*
Select DX Template Remover from the operating system Start menu or Apps screen.
*
In PCC, select DataExchange then Template Remover.
The Template Remover wizard displays its welcome dialog.
2
Click Next.
Template Remover asks you to choose a template to remove.
3
4
Select Remove DataExchange System Tables and click Yes to confirm that you wish to continue.
5
Select Remove DSN and database name and click Next.
The wizard removes the template and presents a summary.
6
Click Close.
Delete Files on the First Site
*
1
*
*
The folder <Installation Directory >\Replication\Templates\Dxdatabase.
Delete Database and Files on the Partner Site
*
1
On the Partner Site, start PCC if it is not already running. (Select Control Center & Documentation from the Pervasive group on the Start menu.)
2
3
Right-click <DSN>, then click Delete.
The Delete Database Wizard starts.
4
Verify that <DSN> is the database name selected and that the options Delete database name and Delete system files are selected.
5
Click Next.
6
Click Finish.
7
Click Close.
8
Restore the Database Copy
*
1
2
In this example, the location to which files restored is \PVSW\Demodata.
Removing Databases Deployed with Designer
DataExchange Designer is a deprecated utility that was included with DataExchange prior to version 5.10. You may need to remove a database that was deployed with DataExchange Designer. Use the following tasks to complete the removal of a database deployed using DataExchange Designer.
1
2
3
4
Deactivate the Example Database on Both Sites
*
For this example, the value for DSN is Demodata.
1
Run DXdeact DSN at the First Site.
2
Run DXdeact DSN at the Partner Site.
Run Template Remover on the First Site
*
1
On the First Site, Select DataExchange Template Remover from the Pervasive group on the Start menu.
The Template Remover Wizard displays its welcome dialog.
2
Click Next.
Template Remover asks you to choose a template to remove.
3
In this example, the value of DSN is 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 and click Next.
The wizard removes the template and presents a summary.
6
Click Close.
Delete Database and Files on the Partner Site
*
1
In this example, the location is <drive>:\Documents and Settings\All Users\Application Data\Pervasive Software\PSQL\Demodata.
2
Restore the Database Copy
*
1
2
In this example, the location to which files are restored is <drive>:\Documents and Settings\All Users\Application Data\Pervasive Software\PSQL\Demodata.
Replication Deployment Using the Deployment Wizard
Data Synchronization deployment can be implemented using the DataExchange Deployment Wizard. The Deployment Wizard is a step-by-step wizard for deploying replication at First and Partner Sites and includes a means of creating a replication schedule. The Deployment Wizard provides automation of the procedures for the DataExchange command-line utility dxdeploy.exe.
Access the Deployment Wizard from Pervasive Control Center by selecting DataExchange Deployment Wizard.
Before You Get Started
Before you start the DataExchange Deployment Wizard, we recommend that you review the following deployment attributes. It is a good idea to make note of these items for the database you are deploying, as they are needed to complete the Deployment Wizard.
*
Project Name – this 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.
*
*
*
*
For detailed information about these attributes, see XML Attributes in Deployment Descriptor File in Getting Started with Pervasive DataExchange.
1-Way Deployment Using DXDeploy
This section provides a step-by-step discussion on deploying a replication solution using the DXDeploy utility and the EXPRESS.XML descriptor template to create your XML descriptor file.
You need two machines for the example session. One machine must have DataExchange installed as a First Site. The other machine must have DataExchange installed as a Partner Site.
This section contains the following tasks:
1
2
3
4
Note This section covers only deployment and does not discuss setting up a replication schedule.
Before You Get Started
Before performing this task you must install Pervasive DataExchange on First Site and a Partner Site as explained in Getting Started with Pervasive DataExchange.
Tip So that you can restore your database to its original state after this deployment exercise, we recommend saving a copy of your database files before proceeding with this example.
In order to complete the changes necessary to the XML descriptor file, we recommend that you make note of the following items:
*
*
*
*
Caution All applications using the database you are about to deploy must be shut down before using this deployment method.
Create the XML Descriptor File
*
1
Open the XML descriptor template file EXPRESS.XML in a text editor, such as Notepad, or copy and paste the following EXPRESS.XML text in a new file. The file is located in the \PVSW\Replication\Docs directory.
Tip The XML Descriptor template file used in the following example displays items that you need to change in italics. As each entry is completed in the instructions, they are shown in bold.
Note The <!-- and --> tags indicate comments and are ignored by DXDeploy. The comments included in the template files are intended as informational and may be edited or deleted.
You should see something similar to the following.
<?xml version="1.0" ?>
<DXDeployment>
   <Configuration Project="DXProj" Network="DXNet" Release="1.0" Method="1-way">
 
<!--
The express deployment requires knowing the following:
- the names or IP addresses of the two database servers
- the root path of the source data
- the directories and file names of the source data
- the root path to which the data should be replicated
-->
 
<Sites>
   <First ServerName="this.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA">
 
<!--
In <Files>, enter paths of data files.
 
Both Include and Exclude paths have the following properties:
Relative paths are relative to DataDirectory given in <First>.
Paths can specify files (not directories) individually or by wildcard.
Subdirectories in paths are not automatically included.
 
Subdirectories for include and exclude are supported. For example,
<Include Path="MoreData\dataFile.mkd" />
<Exclude Path="OtherData\*" />
-->
 
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.btr" />
  <Include Path="*.dat" />
 
<!--
We recommend replicating DDFs. See the User's Guide for more info.
-->
 
  <Include Path="*.ddf" />
</Files>
  </First>
 
  <Partner ServerName="remote.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
</Sites>
  </Configuration>
</DXDeployment>
Caution You must edit the XML Descriptor file to include the required information in order for DXDeploy to successfully replicate your data.
2
Save EXPRESS.XML as EXP_1WAY.XML.
Saving the template file with a new name retains the EXPRESS.XML template for you to use again. You may save the file to the location of your choice on your First Site machine. For ease of discussion, this task assumes that you saved it to C:\PVSW\Replication\Docs.
Tip In the event the EXPRESS.XML file is no longer available on your system, copy the text included in this file to recreate a template descriptor file.
Configuration Project
You will first enter the information needed by DXDeploy to configure your replication project. This information includes your replication project name, network and release.
In your newly created EXP_1WAY.XML file, find the following:
<Configuration Project="DXProj" Network="DXNet" Release="1.0" Method="1-way">
1
For example, if you are replicating a database named mydatabase, then you might name the project mydbproject. Using this as our example, change DXProj to mydbproject. The line would now read:
<Configuration Project="mydbproject" Network="DXNet" Release="1.0" Method="1-way">
2
For example, if the sites included in your replication network are sites in the sales department, then you could name your network sales dept net. Using this as our example, change DXNet to sales dept net. The line would now read:
<Configuration Project="mydbproject" Network="sales dept net" Release="1.0" Method="1-way">
3
For our example, we’ll make this release name 1.0, since it’s our first design on this replication database. Using this example, the line would now read:
<Configuration Project="mydbproject" Network="sales dept net" Release="1.0" Method="1-way">
4
Because this example illustrates 1-way deployment, you will retain the 1-way entry. Our example would now read:
<Configuration Project="mydbproject" Network="sales dept net" Release="1.0" Method="1-way">
Sites - First ServerName
Next, you will enter the First ServerName information needed by DXDeploy. This information includes the name of your First Site machine, the DSN you wish to associate with your replication design, and the data directory location for the data with which you want to replicate.
<First ServerName="this.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA">
1
For example, if the name of your First Site is SiteA, change this.hostname to SiteA. The line would now read:
<First ServerName="SiteA" DSN="DXDatabase" DataDirectory="C:\MYDATA">
Note “Localhost” is not permitted as the machine name.
2
For example, if the database you are replicating contains all the data for the sales department, you might enter a DSN named SalesDB. Using this example, change DXDatabase to SalesDB. The line would now read:
<First ServerName="SiteA" DSN="SalesDB" DataDirectory="C:\MYDATA">
3
For example, the location of your sales database is on your First Site machine at the C:\CompanyData\SalesData location. Using this as our example, you would change C:\MYDATA to C:\CompanyData\SalesData. The line would now read:
<First ServerName="SiteA" DSN="SalesDB" DataDirectory="C:\CompanyData\SalesData">
Files
Now you need to specify the tables in your database that you want to include and exclude from your replication design. In simplest terms, you specify the data you want to replicate and the data you don’t want to replicate.
The Include Path entries listed here are not all required; they simply illustrate the file formats accepted by DXDeploy. The template includes the following examples:
<Include Path="*.mkd" />
<Include Path="*.btr" />
<Include Path="*.dat" />
<Include Path="*.ddf" />
1
Because the Sales database that we are using was created in Pervasive Control Center using the Create Database wizard, the data files have the .mkd or .ddf file extensions. For this example, delete <Include Path="*.dat" /> and <Include Path="*.btr" /> references. (These entries are shown next with strikethrough applied.)
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.btr" />
  <Include Path="*.dat" />
  <Include Path="*.ddf" />
2
Because the database has data dictionary files (DDFs), retain the <Include Path="*.ddf" /> line. Typically, you want to replicate your DDFs to maintain a backup version of them. Note that the DSN created by DXDeploy will not use the database DDFs. DXDeploy creates its own DDFs for specific use by replication. The Files section now looks something like this:
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.ddf" />
3
  <Include Path="MoreData\dataFile.mkd" />
  <Exclude Path="OtherData\*" />
So as an example, to add a subdirectory named SalesReports, change the <Include Path="MoreData\dataFile.mkd" /> to <Include Path="SalesReports\*" /> and add it to the Files section. Now, the Files section should look similar to the following:
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.ddf" />
  <Include Path="SalesReports\*" />
4
For example, if you wanted to exclude a file named Q1Rept located in the SalesReports subdirectory you just added, you would change the <Exclude Path="OtherData\*" /> to <Exclude Path="SalesReports\Q1Rept.mkd" />. Now, the files section should look similar to the following:
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.ddf" />
  <Include Path="SalesReports\*" />
  <Include Path="SalesReports\Q1Rept.mkd" />
Another exclude example would be to exclude the leads table from the Sales Database replication design. Because statements are relative to the DataDirectory path you specified, you would add <Exclude Path="leads.mkd" /> to your descriptor file. Now, the files section should look similar to the following:
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.ddf" />
  <Include Path="SalesReports\*" />
  <Include Path="SalesReports\Q1Rept.mkd" />
  <Include Path="leads.mkd" />
The next example illustrates how to use an Include Path statement with an absolute path location. Because DataExchange supports the use of absolute paths, we can add a table located outside the DataDirectory location specified. It is important to note that absolute paths, if specified, must all start with the same drive letter, which must be the same drive letter specified by DataDirectory.
For our example, you would add <Include Path="C:\Employee\SalesRep\sample.mkd" /> to your descriptor file. This statement includes a table named sample.mkd located at C:\Employee\SalesRep, which is outside the DataDirectory location specified. Now, the files section should look similar to the following:
<Files>
  <Include Path="*.mkd" />
  <Include Path="*.ddf" />
  <Include Path="SalesReports\*" />
  <Include Path="SalesReports\Q1Rept.mkd" />
  <Include Path="leads.mkd" />
  <Include Path="C:\Employee\SalesRep\sample.mkd" />
Sites - Partner ServerName
Next, you will enter the Partner ServerName information. This information includes the machine name or IP Address of your Partner Site, the DSN you wish to associate with your replication design, and the data directory location for the data which you want to replicate.
  <Partner ServerName="remote.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
1
For example, if the machine name of your Partner Site is SiteB, you would change remote.hostname to SiteB. The entry would now look like the following:
  <Partner ServerName="SiteB" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
2
For this example, change DSN="DXDatabase" to DSN="SalesDB". The line would now read:
  <Partner ServerName="SiteB" DSN="SalesDB" DataDirectory="C:\MYDATA" />
3
For our example, in the line for Partner Servername, change DataDirectory="C:\MYDATA" to DataDirectory="C:\CompanyData\SalesData".
The line should read something similar to the following:
  <Partner ServerName="SiteB" DSN="SalesDB" DataDirectory="C:CompanyData\SalesData" />
4
Run DXDeploy on the First Site
*
1
DXDeploy C:\PVSW\Replication\Docs\EXP_1WAY.XML
The command is case-insensitive.
2
Press Enter.
As DXDeploy executes, high-level status messages display on the screen as it completes certain actions. For a successful deployment, the following messages appear:
*
*
*
*
By default, detailed messages from DXDeploy are written to dxdeploy.log, not to the screen. This log is located in the <Installation Directory >\Replication\LogFiles folder. If you want to view detailed messages on the screen while DXDeploy executes, use the /LOGFILE= option.
3
DXDeploy /LOGFILE= C:\PVSW\Replication\Docs\EXP_1WAY.XML
DXDeploy is complete when the command prompt reappears. You may also check the DXDeploy log file to determine when DXDeploy completes. The following message appears at the bottom of the log file: “Successfully completed all deployment actions.”
1
Optionally, start PCC if it is not already running. (Select Control Center & Documentation from the operating system Start menu or Start screen.)
2
Figure 5-1 SalesDB Database Activated on First Site
Copy the Template to the Partner Site
*
1
After DXDeploy completes on the First Site, copy the SalesData directory from \PVSW\Replication\Templates\SalesDB to C:\CompanyData on your Partner Site.
Note Note that the example used here contains data files in both relative and absolute locations. When copying your files, you must include absolute paths to data residing outside the DataDirectory location you specified. For information on where to copy your files, see File Copying in Getting Started with Pervasive DataExchange.
Tip When using DXDeploy deployment, the template consists of a copy of the database files. These files are all located in the directory C:\PVSW\Replication\Templates.
Run DXDeploy on the Partner Site
*
1
2
DXDeploy C:\CompanyData\SalesData\EXP_1WAY.XML
The command is case-insensitive.
3
Press Enter.
DXDeploy provides high-level status messages on the screen as it completes certain actions. For a successful deployment, the following messages appear:
*
*
*
By default, detailed messages from DXDeploy are written to dxdeploy.log, not to the screen. DXDeploy is complete when the command prompt reappears. You may also check the DXDeploy log file to determine when DXDeploy completes. The following message appears at the bottom of the log file: “Successfully completed all deployment actions.”
When DXDeploy runs on the Partner Site, it performs an initial replication with the First Site. This replication populates data on the Partner Site so that it is the same as on the First Site.
Note Depending on database size and connection bandwidth, initial replication can take from a few minutes to several hours.
Tip For steps to remove the deployed database you just created, see Working with the Examples and Removing Databases Deployed with DXDeploy.
2-Way Deployment Using DXDeploy
This section provides a high level discussion for how to deploy a database for replication using the DXDeploy utility. This section uses the sample database, TRACKER, as a working example. TRACKER is provided with the installation of the Pervasive PSQL Server or Workgroup product.
You need two machines for the example session. One machine must have DataExchange installed as a First Site. The other machine must have DataExchange installed as a Partner Site.
This section contains the following tasks:
1
2
3
4
This section omits setting up a replication schedule. Since the TRACKER deployment is only an example, setting up a regular replication schedule is unnecessary.
Before You Get Started
Before performing this task you must install Pervasive DataExchange on a First Site and a Partner Site as explained in Getting Started with Pervasive DataExchange.
Tip So that you can restore your database to its original state after this deployment exercise, we recommend saving a copy of your database files before proceeding with this example.
In order to complete the changes necessary to the XML descriptor file, we recommend that you make note of the following items:
*
*
*
*
Caution All applications using the database you are about to deploy must be shut down before using this deployment method.
Create the XML Descriptor File
*
1
Open the XML descriptor file CUSTOM.XML in a text editor, or copy and paste the following CUSTOM.XML text in a new file. The file is located in the \PVSW\Replication\Docs directory.
Tip The XML Descriptor template file used in the following example displays items that you need to change in italics. As each entry is completed in the instructions, they are shown in bold.
Note The <!-- and --> tags indicate comments and are ignored by DXDeploy. The comments included in the template files are intended as informational and may be edited or deleted.
You should see something similar to the following.
<?xml version="1.0"?>
<DXDeployment>
 
<!--
Change Method to "2-way" for 2-way Data Synchronization deployments.
-->
 
   <Configuration Project="DXProj" Network="DXNet" Release="1.0" Method="1-way">
 
<!--
In <Sites>, enter hostnames or IP addresses of First and Partner sites. Do not enter "localhost". Specify DataDirectory presently containing data files on First Site, and DataDirectory to contain data files on Partner Site.
-->
 
<Sites>
   <First ServerName="this.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA">
 
<!--
In <Files>, enter paths of data files.
Both Include and Exclude paths have the following properties:
Relative paths are relative to DataDirectory given in <Sites>.
Absolute paths must all start with the same drive letter, which must be the same drive letter as in DataDirectory.
Absolute paths cannot be used if sites are located on the same server.
Paths can specify files (not directories) individually or by wildcard.
Paths are not recursive (subdirectories are not included.)
Subdirectories for include and exclude are supported. Examples below.
-->
 
<Files>
  <Include Path="*.mkd" />
  <Include Path="MoreData\dataFile.dat" />
  <Exclude Path="DontNeed.dat" />
  <Include Path="C:\OtherDir\*" />
  <Exclude Path="C:\OtherDir\Temp*" />
 
<!--
DDF changes can be replicated, but will not become automatically effective in the schema of partner database.
-->
 
  <Include Path="*.ddf" />
</Files>
  </First>
 
  <Partner ServerName="remote.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
<!--
<Files> is not applicable in <Partner>; files in <First> are used.
-->
 
</Sites>
  </Configuration>
 
<!--
Optionally, remove actions to be omitted. An empty <Actions> section will only validate this deployment descriptor. Actions can only be removed from the end of the list (e.g. remove Activate, or remove Activate and Design.)
-->
 
<Actions>
<CreateDSN />
<Design />
<Activate />
</Actions>
</DXDeployment>
Caution You must edit the XML Descriptor file to include the required information in order for DXDeploy to successfully replicate your data.
2
Save CUSTOM.XML as CUST_2WAY.XML.
You may save the file to the location of your choice on your First Site machine. For ease of discussion, this task assumes that you save it to C:\PVSW\Replication\Docs.
Tip In the event the CUSTOM.XML file is no longer available on your system, copy the text included in this file to recreate a template descriptor file.
Configuration Project
You will first enter the information needed by DXDeploy to configure your replication project. This information includes your replication project name, network and release.
In your newly created CUST_2WAY.XML file, find the following:
<Configuration Project="DXProj" Network="DXNet" Release="1.0" Method="1-way">
1
For example, if you are replicating a database named mydatabase, then you might name the project mydbproject. Using this as our example, change DXProj to mydbproject. The line would now read:
<Configuration Project="mydbproject" Network="DXNet" Release="1.0" Method="1-way">
2
For example, if the sites included in your replication network are sites in the administration department, then you could name your network admin dept net. Using this as our example, change DXNet to admin dept net. The line would now read:
<Configuration Project="mydbproject" Network="admin dept net" Release="1.0" Method="1-way">
3
For our example, we’ll make this release name 1.0, since it’s our first design on this replication database. Using this example, the line would now read:
<Configuration Project="mydbproject" Network="admin dept net" Release="1.0" Method="1-way">
4
Because this example illustrates 2-way deployment, change the 1-way entry to 2-way. Our example would now read:
<Configuration Project="mydbproject" Network="admin dept net" Release="1.0" Method="2-way">
Sites - First ServerName
Next, you will enter the First ServerName information needed by DXDeploy. This information includes the name of your First Site machine, the DSN you wish to associate with your replication design, and the data directory location for the data with which you want to replicate.
<First ServerName="this.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA">
1
For example, if the name of your First Site is SiteA, change this.hostname to SiteA. The line would now read:
<First ServerName="SiteA" DSN="DXDatabase" DataDirectory="C:\MYDATA">
Note “Localhost” is not permitted as the machine name.
2
Since our example uses the Tracker database, you might enter a DSN named TrackerDB. Using this example, change DXDatabase to TrackerDB. The line would now read:
<First ServerName="SiteA" DSN="TrackerDB" DataDirectory="C:\MYDATA">
3
For example, the location of your Tracker database is on your First Site machine at the <Installation Directory >\Replication\Demodb location. Using this as our example, you would change C:\MYDATA to C:\PVSW\Replication\Demodb. The line would now read:
<First ServerName="SiteA" DSN="TrackerDB" DataDirectory="C:\PVSW\Replication\Demodb">
Files
Now you need to specify the tables in your database that you want to include and exclude from your replication design. In simplest terms, you specify the data you want to replicate and the data you don’t want to replicate.
The Include and Exclude Path entries listed here are not all required; they simply illustrate examples of how Include and Exclude Path statements can be structured. The template includes the following examples:
  <Include Path="*.mkd" />
  <Include Path="MoreData\dataFile.dat" />
  <Exclude Path="DontNeed.dat" />
  <Include Path="C:\OtherDir\*" />
  <Exclude Path="C:\OtherDir\Temp*" />
1
Because the Tracker database that we are using is a SQL database, the data files have the .mkd file extension. For this example, you will retain the <Include Path="*.mkd" /> statement to include all of your Tracker data files. The Files section now looks something like this:
<Files>
  <Include Path="*.mkd" />
  <Include Path="MoreData\dataFile.dat" />
  <Exclude Path="DontNeed.dat" />
  <Include Path="C:\OtherDir\*" />
  <Exclude Path="C:\OtherDir\Temp*" />
2
For example, say you have a subdirectory called C:\PVSW\Replication\Demodb\Misc, which contains misc_file1.dat, misc_file2.dat, and misc_file3.dat. You want to include all of these files except misc_file3.dat. You would change <Include Path="MoreData\dataFile.dat" /> to <Include Path="Misc\*.dat" />. Then you would change <Exclude Path="DontNeed.dat" /> to <Exclude Path="Misc\misc_file3.dat" />. The entry would look something like this:
  <Include Path="*.mkd" />
  <Include Path="Misc\*.dat" />
  <Include Path="Misc\misc_file3.dat" />
Another example would be to include or exclude data that falls outside of the DataDictionary path you specified, or at an absolute path location. In other words, data you want to replicate that does not reside in C:\PVSW\Replication\Demodb, but instead resides at the C:\Archive location. Because DataExchange supports the use of absolute paths, we can add a table located outside the DataDirectory location specified. It is important to note that absolute paths, if specified, must all start with the same drive letter, which must be the same drive letter specified by DataDirectory.
For our example, we’ll say that there is one file at this location that you want to exclude from the replication design; this file is C:\Archive\History.dat. You would change <Include Path="C:\OtherDir\*" /> to <Include Path="C:\Archive\*.dat" />. Then you would change <Exclude Path="C:\OtherDir\Temp*" /> to <Exclude Path="C:\Archive\History.dat" />. Now, the files section should look similar to the following:
<Files>
  <Include Path="*.mkd" />
  <Include Path="Misc\*.dat" />
  <Include Path="Misc\misc_file3.dat" />
  <Include Path="C:\Archive\*.dat" />
  <Include Path="C:\Archive\History.dat" />
3
Because TRACKER has data dictionary files (DDFs), retain the <Include Path="*.ddf" /> line. Typically, you want to replicate your DDFs to maintain a backup version of them. Note that the DSN created by DXDeploy does not use TRACKER’s DDFs. DXDeploy creates its own DDFs for specific use by replication. The completed Files section now looks something like this:
<Files>
  <Include Path="*.mkd" />
  <Include Path="Misc\*.dat" />
  <Include Path="Misc\misc_file3.dat" />
  <Include Path="C:\Archive\*.dat" />
  <Include Path="C:\Archive\History.dat" />
  <Include Path="*.ddf" />
Sites - Partner ServerName
Next, you will enter the Partner ServerName information. This information includes the machine name or IP Address of your Partner Site, the DSN you wish to associate with your replication design, and the data directory location for the data which you want to replicate.
<Partner ServerName="remote.hostname" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
1
For example, if the machine name of your Partner Site is SiteB, you would change remote.hostname to SiteB. The entry would now look like the following:
<Partner ServerName="SiteB" DSN="DXDatabase" DataDirectory="C:\MYDATA" />
2
For this example, change DSN="DXDatabase" to DSN="TrackerDB". The line would now read:
<Partner ServerName="SiteB" DSN="TrackerDB" DataDirectory="C:\MYDATA" />
3
For our example, in the line for Partner Servername, change DataDirectory="C:\MYDATA" to DataDirectory="C:\PVSW\Replication\Demodb".
The line should read something similar to the following:
<Partner ServerName="SiteB" DSN="TrackerDB" DataDirectory="C:\PVSW\Replication\Demodb" />
Actions
Optionally, you can specify actions for DXDeploy to initiate or omit by removing one or more of the Action statements. It is important to note that you can only remove these statements from the bottom up. In other words, you cannot remove <Design /> without removing <Activate /> or DXDeploy will not run successfully.
<CreateDSN />
<Design />
<Activate />
Note If you remove all of the Action statements, all actions will be performed.
1
<Actions>
<CreateDSN />
<Design />
<Activate />
</Actions>
Or remove the section completely to perform all the Actions.
2
Run DXDeploy on the First Site
*
1
2
DXDeploy C:\PVSW\Replication\Docs\CUST_2WAY.XML
The command is case-insensitive.
3
Press Enter.
DXDeploy provides high-level status messages on the screen as it completes certain actions. For a successful deployment, the following messages appear:
*
*
*
*
By default, detailed messages from DXDeploy are written to dxdeploy.log, not to the screen. This log is located in the <Installation Directory >\Replication\LogFiles folder. If you want to view detailed messages on the screen while DXDeploy executes, use the /LOGFILE= option. For example, DXDeploy /LOGFILE= CUST_2WAY.XML. (A space character follows the equal sign.)
DXDeploy is complete when the command prompt reappears. You may also check the DXDeploy log file to determine when DXDeploy completes. The following message appears at the bottom of the log file: “Successfully completed all deployment actions.”
4
Figure 5-2 TrackerDB Activated on First Site
Copy the Template to the Partner Site
*
1
After DXDeploy completes on the First Site, copy the DemoDB directory from C:\PVSW\Replication\Templates\TrackerDB to C:\PVSW\Replication on your Partner Site.
Note that the example used here contains data files in both relative and absolute locations. When copying your files, you must include absolute paths to data residing outside the DataDirectory location you specified. For information on where to copy your files, see File Copying in Getting Started with Pervasive DataExchange.
Note When using DXDeploy deployment, the template consists of a copy of the database files. These files are all located in the <Installation Directory >\Replication\Templates directory.
Run DXDeploy on the Partner Site
*
1
2
DXDeploy C:\PVSW\Replication\DemoDB\CUST_2WAY.XML
The command is case-insensitive.
3
Press Enter.
DXDeploy provides high-level status messages on the screen as it completes certain actions. For a successful deployment, the following messages appear:
*
*
*
By default, detailed messages from DXDeploy are written to dxdeploy.log, not to the screen. DXDeploy is complete when the command prompt reappears. You may also check the DXDeploy log file to determine when DXDeploy completes. The following message appears at the bottom of the log file: “Successfully completed all deployment actions.”
When DXDeploy runs on the Partner Site, it performs an initial replication with the First Site. This replication populates data on the Partner Site so that it is the same as on the First Site.
Note Depending on database size and connection bandwidth, initial replication can take from a few minutes to several hours.
Tip For steps to remove the deployed database you just created, see Working with the Examples and Removing Databases Deployed with DXDeploy.