This knowledge article contains several warnings, prerequisites, and important precautions throughout the instructions. Please read the entire article carefully and ensure that all prerequisites and cautionary notes are understood before proceeding. Users are responsible for reviewing each step.
Need
The development environment (design repository and data location) has to be recreated from scratch, for example after a platform migration, a corrupted repository or a disaster, but the model has already been deployed in production. The question is: which side effects to expect, and how to recreate the environment so that models designed in the new development environment can still be promoted to the existing production environment.
Summarized Solution
The main side effect is the loss of the model lineage. The development and production environments must share the same model identity (the model UUID and its edition numbering). A development environment rebuilt from an empty repository creates a new model identity. When a model is later closed there and imported into production, the import fails with Cannot import <model> because a different model with the same name already exists in the target repository, or a new root model is created instead of a new edition of the existing one.
To avoid it, the new development repository is built from a copy of the production repository, then switched to the design type:
- Export the up-to-date model from the old development environment.
- Delete the data location of the old development environment and drop its schema (the development data is lost).
- Back up the production repository and restore it as the development repository, then set its type to
DESIGN. - Import-replace the model with the exported file.
- Set the model edition to
OPENin the repository table and restart the application server.
The repository types and the procedure to move a model between repositories are described in the xDM documentation. The other side effects (lost data, copied production configuration, fixed repository type) are listed in the detailed solution.
Detailed Solution
Caution: steps 3 and 5 modify internal repository tables directly, and the repository of one environment is restored into another one. This is normally avoided, and it is justified here only because the development environment must inherit the model identity of production. As this is a custom procedure, it must first be tried on a test environment.
Prerequisites
- The same xDM version in the development and production environments. Exporting a model from one product version and importing it into another one is not supported.
- A database backup tool and access to the repository schemas (DBA support if needed).
- The development application server stopped during every update of the repository (the restore and the type change in Step 3, the status change in Step 5), so that nothing writes to the repository tables while they are modified. It is started again only for the model import (Step 4) and for the final check (Step 6).
Production is only read during this procedure: only a backup of its repository is taken.
Step 1: export the up-to-date model from the old development environment
In the Management perspective, expand Model Administration, then the model and its branch. Right-click the edition holding the latest work (the open edition), select Export Model Edition..., choose the encoding and save the XML file. Keep this file safe: it is the only copy of the work in progress.
Step 2: delete the old development data location and schema
Delete the data location in the development environment, then drop its schema.
The data in the development environment is lost. Production data can be loaded again afterwards with the procedure described in the article "Refresh an xDM development/test environment with production data".
Step 3: restore the production repository as the development repository
- In production, back up the repository schema with the database tool (the backup tool depends on the database: Data Pump for Oracle,
pg_dumpfor PostgreSQL,BACKUP DATABASEfor SQL Server). - Restore this backup into the development repository schema, which replaces the previous development repository.
- Set the repository type to design. The type is fixed when a repository is created and cannot be changed from the interface, so it is changed in the table:
update mta_repository set repotype = 'DESIGN';The restored repository contains the production configuration: models, data location definitions, jobs and security. Before starting the development server, make sure it uses its own data sources and never points to a production schema.
Step 4: import-replace the model
Start the development application server and open the Management perspective. Right-click the model edition, select Import Replace..., choose the file exported in Step 1 and confirm. The existing edition is replaced by the content of the file.
Step 5: reopen the model edition
In the development repository, find the edition and set its status to open:
select * from mta_model_edition;
update mta_model_edition set status = 'OPEN' where uuid = '<uuid of the edition>';Only the edition that has just been replaced must be reopened. Production editions that were already closed stay closed.
Step 6: restart and check
Restart the application server. Without the restart, the Application Builder still shows the edition as closed.
Then check that:
- The model appears under the same name and with the same edition numbers as in production.
- The edition is open in Model Design and can be edited.
- A data location can be created again for the development schema if needed.
- Closing the edition produces the next edition number of the production model. Importing this closed edition in production then creates a new edition of the existing model, not a new model.
Side effects to expect
Side effect | Why | What to do |
|---|---|---|
Development data lost | The data location and its schema are deleted in Step 2. | Load production data again with the refresh procedure, or create a data location referencing an existing schema. |
Production configuration copied | The restored repository holds models, data location definitions, jobs and security of production. | Update data sources, data locations and users before starting loads. |
Repository type | The type is fixed at creation, and a restored production repository is a deployment repository. | Set it to |
Model identity | A new empty development repository creates a new model UUID. | Start from the production repository (Step 3), not from an empty one. |
Work not yet exported | Anything not exported in Step 1 is lost. | Export the open edition before touching the old environment. |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article