Automating DBXL tasks with the DBXL Migration Tool - David Airapetyan
in

InfoPath Dev

David Airapetyan

Automating DBXL tasks with the DBXL Migration Tool

Two commonly requested features for Qdabra DBXL are automatically populating the database and migrating content from one site to another. We have developed a tool that allows you to do both.The DBXL Document Deployer is an XML-driven, command-line tool with pluggable architecture that is simple to configure and that can automate many operations you'd typically do manually via the DBXL Administration Tool (also known as DAT). A Document Deployer plug-in called the MigrationTool allows you to easily export document types along with their settings and documents from a DBXL instance and then subsequently re-import them into another one.

Getting Started

Download the tool here: http://www.infopathdev.com/files/folders/document_deployer/default.aspx

The first step is to configure the tool to point to your local DBXL. Do this by selecting Programs/Qdabra DBXL Migration Tool/Configure from your start menu, changing the value of DbxlRoot to your local instance and saving the configuration file.The Document Deployer tool uses XML Scenario files that define the actions that need to be executed. Each scenario file is split into two sections: the complex ActionDefinitions part that defines various DBXL actions and the Runs section which invokes those actions.Defining action definitions can be a daunting task but do not worry, you can do a lot with the existing sample action definitions that ship with Document Deployer!  To start the Document Deployer shell, select Programs/Qdabra DBXL Migration Tool/DBXL Migration Tool.

Here are a few examples of what you can do:

 
  1. Create sample taxonomy for the QdCatalogBase document type that ships with DBXL 2.1:
DocumentDeployer.exe Scenarios\QdCatBaseTaxonomy.xml CreateTaxonomy      Note: taxonomies are used to browse forms via the QdCatalogBase taskpane.
  1. Deploy sample documents for the QdCatalogBase document type:
DocumentDeployer.exe Scenarios\DeployQdCatBaseInstances.xml PopulateCatalogBase
  1. Publish a new document type that contains pictures:
DocumentDeployer.exe Scenarios\DeployPictureForm.xml PublishPictures
  1. Bulk deployment of documents with pictures (requires a previous PublishPictures deployment, requires Vista):
DocumentDeployer.exe Scenarios\DeployPictureForm.xml BulkDeploy
  1. Export the QdCatalogBase document type and all its documents
DocumentDeployer.exe Scenarios\Migrate.xml ExportCatBase
  1. Export the QdCatalogBase document type, all its documents and the complete taxonomy
DocumentDeployer.exe Scenarios\Migrate.xml ExportFullCatBaseIf you want to achieve other tasks either create a new scenario file or modify an existing one. Mind you that you can import action definitions from other scenario files without having to copy them over! See Scenarios\Migrate.xml for an example.DocumentDeployer comes with two documentation files (available from the Start menu via Programs/Qdabra DBXL Migration Tool) that contain more details on the tool itself and the MigrationTool plug-in. 

List of all Scenario files and their Action Definitions

QdCatBaseTaxonomy.xml

This scenario defines actions that can populate the taxonomy for the qForm solution that ships as part of DBXL 2.1. It contains the following action definitions:

-          AddHierarchy: adds a hierarchy to a specified doctype
-          AddCategory: adds a category for a specified hierarchy
-          ChainCategory: puts one category under another
-          EnumerateDocumentIds: lists documents matching specific criteria
-          RemoveEnumeratedDocuments: removes listed documents

DeployQdCatBaseInstances.xml

This scenario defines actions that can create instances of the qForm solution and accomplish complex tasks such as tagging documents and assigning workflow. It contains the following action definitions:

-          GetHierarchy: gets the docid of a specific QdCatalogBase hierarchy
-          EnumerateDocumentIds: lists documents matching specific criteria
-          RemoveEnumeratedDocuments: removes listed documents
-          RemoveAllDocuments: removes all documents for a doctype
-          TagDocument: tags a document with a specified category
-          AddEmailFlow: adds e-mail flow to a document
-          AddCatalogBase: adds an instance of the qForm

Cleanup.xml

This scenario contains only one generic RemoveAllDocuments action definition that eases DBXL cleanup.

DeployPictureForm.xml

This scenario demonstrates the use of compile-on-the-fly plugins and bulk deployment. It contains the following action definitions:

-          UploadDoctype: uploads a hardcoded doctype (can be modified to be made more generic)
-          AddPictureDocument: uploads one document with a base64-encoded image
-          BulkDeploy: uses an external plug-in to upload all sample pictures (requires Vista to work as-is)

MigrateCore.xml

This scenario defines action definitions for the MigrationTool plugin and allows to export/import documents and doctypes. It contains the following action definitions:

-          ExportDocType: exports a specified doctype to a given folder
-          ListDocumentsForDoctype: enumerates all documents for the specified doctype
-          DownloadListedDocuments: exports documents listed by the previous action definition
-          ImportDocType: imports a specified doctype into DBXL
-          ImportDocuments: imports specified documents into DBXL
-          ExportDoctypeWithTaxonomyAndFlow: a complex action definition that can export a qForm-derived solution along with all its taxonomy and flow
-          ImportDoctypeWithTaxonomyAndFlow: a complex action definition that can import a qForm-derived solution along with all its taxonomy and flow

 

Each of the scenario files (other than MigrateCore.xml) contains examples of how to use the actions. For document migration, the usage examples are in a separate file, Migrate.xml. This file also demonstrates how you can easily build your own scenario by importing action definitions from existing scenario files.

Comments

 

davidair said:

Addendum: it turns out that DocumentDeployer will also run against a DBXL 2.0 instance. However, you need to make sure that you do not use the new DB aliases such as #DBXLDB# (sample XML files make use of it to keep the examples generic). Instead, you will have to replace #DBXLDB# with the actual database name.

September 5, 2007 9:47 PM
 

Patrick Halstead said:

This is a great tool for auto-populating test sites or taking backups of existing sites. You can also migrate solutions from one site to another. Check out David's post on how to do migration: www.infopathdev.com/.../how-to-migrate-complex-solutions-using-the-migration-tool.aspx.

September 9, 2007 12:05 PM
 

How to migrate complex solutions using the Migration Tool - David Airapetyan said:

Pingback from  How to migrate complex solutions using the Migration Tool - David Airapetyan

July 17, 2008 12:44 PM

About davidair

I am a Computer Science graduate from McGill University in Montreal, Canada. I have over seven years of industry experience including almost five of them spent with the Microsoft Corporation where I shipped several versions of Microsoft Office InfoPath. Originally from Russia, I am fluent in several languages, including Russian, English, French, C#, C++ and Perl. I currently reside in Montreal and work for Qdabra Software.
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.