It is possible to Migrate Content using our Export/Import Migration Scripts that enable System Admins to setup a content migration pipeline. The article shows an example of how to migrate content from one server to another.
The Scripted Migration process includes two main stages:
Migration Capabilities
NOTE: Root privileges are required to run Migration.
| MI Elements and Objects | Scripted Migration | Details | 
| Metrics | can be migrated | BEFORE MIGRATION, on the new instance make sure to: 
 | 
| Reports | can be migrated | |
| External Reports | can be migrated | |
| Datasets/Users Maps | can be migrated | |
| Categories | can be migrated | |
| Folders | can be migrated | |
| Apps (Portal Pages) | can be migrated | |
| Bursts | can be migrated | |
| Email Templates | can be migrated | |
| Groups | can be migrated | |
| Business Units | can be migrated | |
| Privilege Sets | can be migrated | |
| Brands | can be migrated | |
| Custom Fields | can be migrated | |
| Dimensions | can be migrated | ALL OBJECTS AND ENTITIES that cannot be migrated directly have to be rebuilt on the new instance. | 
| Plugin Data Sources | NOT SUPPORTED | 
Key Migration Dependencies
| Migration Dependencies | ||
|---|---|---|
| Element/Object IDs | 
 | |
| Data Sources | 
 | 
 | 
1. Exporting Content
Exporting content involves creating a .tar.gz file with information on all migrated Elements/Objects that can later be uploaded to a different server.
All associated Documents/Previews/Attachaments/JS Templates can be exported in an archive as separate files.
To initiate export, run the following command:
python3.12 /opt/mi/migration-tool/run.py export -c 86 -f  /<directory>/<archive name>.tar.gzwhere:
- 
python3.12is a Python Interpreter (installed during the installation of the MI application);
- 
/opt/mi/migration-tool/run.pyis a migration script;
- 
exportis a command which should be performed;
- 
-c 86is a Category parameter followed by Category ID;
- 
-fparameter specifies the name for the output archive;
- 
<directory>where the dump file will be created;
- 
<archive name>.tar.gzis a user-defined archive name.
To export a Category (as an example):
- Run run.py exportwith the desired parameters.
- The response of the script will contain an integer, which is the migration_export_logtable ID. The table along withmigration_export_log_entitiycontains details about the export.- NOTE: In case of fatal errors, the response will return an error text message. This may happen when the program is not able to connect to the DB or some system migration tables were absent (or corrupted).
 
- 
Optionally, verify that the Category was saved to the tar.gzarchive with the name you specified.
- 
Optionally, view the contents of the exported tar.gzarchive.- In an archive, Documents are stored by Number IDs.
- The actual Document names are stored inside a .jsonfile.
 
1.1. Optional Parameters for Export
| The list of arguments to use at export | ||
|---|---|---|
| -h, --help | Show help message and exit | |
| -e ELEMENTS [ELEMENTS ...], --elements ELEMENTS [ELEMENTS ...] | IDs of Elements | |
| --bursts BURSTS [BURSTS ...] | Burst IDs to dump (space-separated) | |
| -d DATASETS [DATASETS ...], --datasets DATASETS [DATASETS ...] | IDs of Datasets | |
| -f FILE_NAME, --file_name FILE_NAME | Output file name | |
| --exclude-access-maps | Do not export any dependent access maps | |
| --folders FOLDERS [FOLDERS ...] | Folder IDs to dump (space-separated) | |
| --group-sharing | Include sharing user groups for migrated objects | |
| -c CATEGORIES [CATEGORIES ...], --categories CATEGORIES [CATEGORIES ...] | Category ID to dump (space-separated) | |
| -g GROUPS [GROUPS ...], --groups GROUPS [GROUPS ...] | Group IDs to dump (space-separated) | |
| -p PORTAL_PAGES [PORTAL_PAGES ...], --portal-pages PORTAL_PAGES [PORTAL_PAGES ...] | App (Portal Page) IDs to dump (space-separated) | |
| --dimensions DIMENSIONS [DIMENSIONS ...] | Dimension IDs to dump (space-separated) | |
| --digest-templates DIGEST_TEMPLATES [DIGEST_TEMPLATES ...] | Digest Template IDs to dump (space-separated) | |
| --business-unit BUSINESS_UNIT [BUSINESS_UNIT ...] | Business Unit IDs to dump (space-separated) | |
| --privilege-sets PRIVILEGE_SETS [PRIVILEGE_SETS ...] | Privilege Set IDs to dump (comma-separated) | |
| --custom-fields CUSTOM_FIELDS [CUSTOM_FIELDS ...] | Custom Field IDs to dump (comma-separated) | |
| --brands BRANDS [BRANDS ...] | Brand IDs to dump (comma-separated) | |
| --include-folders | If an Element is included in Folder, but that Folder has not been explicitly selected for export, this flag will automatically include the Folder along with the Element. | |
| -s, --scheduled | Include scheduled migration | |
| --skip_external_report | Do not dump External Report | |
| --skip_documents | Do include dump Documents in the outcome archive | |
| --skip_other_external_content | Do not dump Other External Content | |
| -db DB_NAME, --db_name DB_NAME | Database schema name | |
| --update_folder_elements | Update the Folder during the width:47.6936%;">--dump_external_images | Dump the External Report collected images | 
| --folder-backup | Provide backup for a specific Folder. Export folder with related Users, Groups, and Elements. During width:47.6936%;">--text_note [TEXT_NOTE] | Export Notes | 
| --freeze-page-variables | Ignore existing App (Portal Page) Variables on target | |
| --involve-targets | Involve targets for the migrated Element | |
| --update-custom-fields | Forcibly update Custom Field metadata | |
To  File to load elements from Output as Python dict (for development purposes only) Directory to back up changed records to Do not overwrite access map configuration Create new Bursts only. Do not update existed Bursts Create topic only for new entities (Elements, Datasets, Portal Pages, Bursts). Skip topics for existing records For new Elements/Datasets, Owner are set to Category owners. For existing records, Owners are not updated For new Elements/Datasets, certified attribute is set to 'N' (reset_certification, last_certified_time as well). For existing records, certified attribute is not updated Delete Elements/Topics in the target Category if they are not in the source Category Load matching Elements Keeping data on target system Do not preserve IDs The rollback command allows users to cancel the  delete
 The rollback operation works with the Objects that were involved in ">
 Show this help message and exit In case Migration runs with errors:migration_ID. The table along with the migration_and migration_tables contains details about the ">
The list of arguments to use at background-color:rgb(239, 239, 239);">-h, --help
 Show this help message and exit 
 
-f FILE_NAME, --file_name FILE_NAME 
 
--test_output 
 
--restore RESTORE 
MigrationRollback PK value 
 
-b BACKUP_DIR, --backup-dir BACKUP_DIR 
 
--preserve-access-map 
 
--burst_create_only 
 
--new_entity_topics_only 
 
--use_category_owner 
 
--reset_certification 
 
-s, --strict 
 
-m, --match 
 
-r, --relax 
 
-n, --no-preserve 
 
-db DB_NAME, --db_name DB_NAME 
Database schema name 
 
--accept_different_versions 
Ignore the difference between the system version and the income archive version 
 
 
  
 
  
      --link-groups-to-profiles 
Link existing User Groups to migrated branding profiles 
3. Rolling Back
      The list of arguments to use at rollback 
 
-h, --help 
 
--force 
Force rollback for DB-operations 
4. If Migration Runs with Errors