How to Export and Import Tenant Data

This article contains the following topics:
This article contains the following topics:
The service provider can extract tenant data from an existing multi-tenancy implementation and import it into a new system.
Depending on the volume of your data, the extraction process can take several hours. You may have to perform the extract and import in multiple phases, as follows:
  • Initial
    Extracts a base line and creates a control file used in subsequent phases .
  • Update
    Uses the control file to extract only data that has changed since the previous run.
  • Final
    Performs the same steps as Update, except that it also extracts animations. Animations are omitted from both the Initial and Update phases.
To extract data from one database and import it into another, complete the following steps:
  1. Run an initial phase of pdm_tenant_extract to extract base-line data. This builds the control file used by subsequent phases.
  2. Prepare a new, clean MDB for the extracted data.
    The output from the initial phase
    be loaded into a database that has never been used for the product or for any other product. Each table loaded from initial phase data is truncated prior to the load, which could cause loss of data if the database is already in use.
  3. To avoid duplicate privileged contacts appearing on the new system, you must inactivate the privileged contacts. Log onto CA SDM and change the Status of these contacts to "inactive" before loading the extracted data.
  4. To avoid referential problems during the data load, run the appropriate drop constraints script:
    • (Oracle) Run $NX_ROOT/samples/views/Oracle/OracleDropConstraints.sql
    • (SQL Server) Run $NX_ROOT/samples/views/SQLServer/SQLDropConstraints.sql
  5. Use pdm_userload to load the data from the initial phase into the clean MDB prepared in steps 2 and 3.
  6. Run an update or final phase of pdm_tenant_extract to extract additional data created or modified since the previous phase. Pdm_tenant_extract uses the control file created in step 1 to determine the data already processed by the previous phase.
  7. Use pdm_userload to load the data extracted in step 5 into the same MDB containing data loaded from the previous phases.
    For more information about this utility, see pdm_userload.
  8. Repeat steps 5 and 6 as required until all data has been imported into the new database. The last run should be the final phase.
  9. To protect the integrity of the new database, restore the constraints dropped in step 3 by running the appropriate add constraints script:
    • (Oracle) Run $NX_ROOT/samples/views/Oracle/OracleAddConstraints.sql
    • (SQL Server) Run $NX_ROOT/samples/views/SQLServer/SQLAddConstraints.sql
  10. Use pdm_tenant_delete to delete the extracted data from the original database.
  11. Ensure that all repositories associated with extracted tenants are copied to the target settings.
How to Handle Attachments and Repositories
Attachments are stored in repositories. You must copy all repositories that are associated with extracted tenants to the target system, including public repositories. This process is primarily a manual operation, with the following steps:
  1. Redefine location-specific information for all repositories, after completion of the initial load of the data into the target system. This task includes changing the following values:
    • Server Name
    • Upload Path
    • Servlet Path
    • Archive Path
  2. Manually create all required directories and folders.
  3. Copy all attachment files from the previous location to the new repository location after (or during) the load of the data from the Final phase.
After you complete these steps, all references for attachments in the target system should be successful. However, copies of the attachments remain on the source system. Use the utility to clean these redundant attachments.