Deploying models

When you are ready to try your model, you deploy it with the Deploy Synchronization Model Wizard. There are multiple things that can be deployed:

  • Changes to the consolidated database.
  • SQL Anywhere or UltraLite remote databases (you can choose to create a database, or add tables to an existing empty database, or use an existing database that already has your remote tables).
  • Batch files to deploy the model (the generated batch files have variable declarations at the beginning that you can edit before running the batch files).
  • Batch files to run the MobiLink server and the MobiLink client.
  • Server-initiated synchronization configuration.

When you deploy a model, the model file is saved.

Deploying to the consolidated database

The Deploy Synchronization Model Wizard provides two options for deploying to the consolidated database:

To deploy a consolidated database from a SQL file

  • When you ran the Deploy Synchronization Model Wizard, if you chose to create a file to run later (on the Consolidated Database Deployment Destination page), you must run the batch file that is located in the consolidated sub-folder of your model. This file creates all the objects you chose to have created in the consolidated database, including synchronization scripts, shadow tables, and triggers. It can also register MobiLink users in the consolidated database.

    To run this file, navigate to the consolidated directory and run the file that ends with _consolidated.bat. You must include connection information. For example, run:

    MyModel_consolidated.bat "dsn=my_odbc_datasource;uid=myuserid;pwd=mypassword"

    For some drivers, the DSN can have the userid and password so they do not need to be specified.

Note

If your deployment creates shadow tables, you must connect to the consolidated database as either the owner of the base tables for which shadow tables are created, or as an administrator.

Deploying remote databases

You can choose to use an existing remote database or have the wizard create one for you. The wizard can create remote databases directly or you can have it create a SQL file that you run to create remote databases.

The wizard creates a remote database (either SQL Anywhere or UltraLite) with default database creation options using the database owner that you specified in the model. Alternatively, you can create a remote database outside of the Create Synchronization Model Wizard with your own custom settings and use the wizard to add the required remote tables, or you can deploy to an existing remote database that already has the remote tables.

To deploy a remote database from a SQL file

  • When you ran the Deploy Synchronization Model Wizard, if you chose to create a file to run later (on the New SQL Anywhere Remote Database page or New UltraLite Remote Database page), you must run the batch file in the remote directory. This file creates all the objects you chose to have created in the remote database, including tables, publications, subscriptions, and MobiLink users.

    To run this file, navigate to the remote directory and run the file that ends with _remote.bat. For example, run:

    MyModel_remote.bat

    You are prompted for a password if you are using an existing remote database.

Deploying batch files to run synchronization tools

The wizard can create the following batch files:

To deploy a model

  1. In Model mode, choose File » Deploy.

    The Deploy Synchronization Model Wizard appears.

  2. Follow the instructions in the wizard. Each page has online help.

  3. When you are finished, the changes you selected are deployed. If there are existing files of the same name, they are overwritten.

  4. To synchronize your application, see Synchronizing a deployed model.


Redeploying a model
Synchronizing a deployed model