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.
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.
1 On the First Site machine, open a command prompt.
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
5
6 Click Close.
DataExchange directory under <DataDirectory>
The folder <Installation Directory >\Replication\Templates\Dxdatabase.
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.)
3
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 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.
1 On the First Site, Select DataExchange Template Remover from the Pervasive group on the Start menu.
2 Click Next.
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
6 Click Close.In this example, the location is <drive>:\Documents and Settings\All Users\Application Data\Pervasive Software\PSQL\Demodata.In this example, the location to which files are restored is <drive>:\Documents and Settings\All Users\Application Data\Pervasive Software\PSQL\Demodata.Access the Deployment Wizard from Pervasive Control Center by selecting DataExchange 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.Before performing this task you must install Pervasive DataExchange on First Site and a Partner Site as explained in Getting Started with Pervasive DataExchange.
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.<Include Path="*.mkd" /><Include Path="*.btr" /><Include Path="*.dat" /><Include Path="*.ddf" />
2 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.In your newly created EXP_1WAY.XML file, find the following: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: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:Because this example illustrates 1-way deployment, you will retain the 1-way entry. Our example would now read:For example, if the name of your First Site is SiteA, change this.hostname to SiteA. The line would now read: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: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: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.)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: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:
4 The Exclude Path statements are relative to the DataDirectory path you specified, just as the Include Path statements. Use the example <Exclude Path="OtherData\*" /> statement to omit files from your replication design.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: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: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: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:For our example, in the line for Partner Servername, change DataDirectory="C:\MYDATA" to DataDirectory="C:\CompanyData\SalesData".
2 Press Enter.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.
1 Optionally, start PCC if it is not already running. (Select Control Center & Documentation from the operating system Start menu or Start screen.)
2 In Pervasive PSQL Explorer under Engines, open the SalesDB database branch. Notice that SalesDB is now listed as a database with the A icon shown on its Replication node. This indicates that the database is activated.
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.
3 Press Enter.Tip For steps to remove the deployed database you just created, see Working with the Examples and Removing Databases Deployed with DXDeploy.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.
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.<Include Path="*.mkd" /><Include Path="MoreData\dataFile.dat" /><Exclude Path="DontNeed.dat" /><Include Path="C:\OtherDir\*" /><Exclude Path="C:\OtherDir\Temp*" /><Include Path="*.ddf" />
2 Save CUSTOM.XML as CUST_2WAY.XML.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.In your newly created CUST_2WAY.XML file, find the following: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: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:Because this example illustrates 2-way deployment, change the 1-way entry to 2-way. Our example would now read:For example, if the name of your First Site is SiteA, change this.hostname to SiteA. The line would now read: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: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: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: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: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: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: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:For our example, in the line for Partner Servername, change DataDirectory="C:\MYDATA" to DataDirectory="C:\PVSW\Replication\Demodb".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.
3 Press Enter.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.)
4 Optionally, open Pervasive Control Center (PCC) and in Pervasive PSQL Explorer under Engines, open the TrackerDB branch. Notice that TrackerDB is now listed as a database with the A icon shown on its Replication node. This indicates that the database is activated.
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.
3 Press Enter.