-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Add the Migration toolkit to your app | ||
npm i @kontent-ai-consulting/migration-toolkit --save-dev | ||
npm i @kontent-ai/migration-toolkit --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 16 additions & 17 deletions
33
ts/migrate-from-other-systems/migration_toolkit_import_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
import { | ||
importAsync, | ||
extractAsync // Only when importing from stored archives | ||
} from "@kontent-ai-consulting/migration-toolkit"; | ||
importAsync, | ||
extractAsync, // Only when importing from stored archives | ||
} from "@kontent-ai/migration-toolkit"; | ||
|
||
// Import from migration objects directly | ||
await importAsync({ | ||
data: { | ||
assets: migrationAssets, | ||
items: migrationItems | ||
}, | ||
environmentId: "KONTENT_AI_ENVIRONMENT_ID", | ||
apiKey: "MANAGEMENT_API_KEY", | ||
data: { | ||
assets: migrationAssets, | ||
items: migrationItems, | ||
}, | ||
environmentId: "KONTENT_AI_ENVIRONMENT_ID", | ||
apiKey: "MANAGEMENT_API_KEY", | ||
}); | ||
|
||
// Extract MigrationItem and MigrationAsset objects from archive | ||
const { assets, items } = await extractAsync({ | ||
filename: 'core_content.zip' | ||
filename: "core_content.zip", | ||
}); | ||
|
||
// Import from stored migration objects | ||
await importAsync({ | ||
environmentId: "KONTENT_AI_ENVIRONMENT_ID", | ||
apiKey: "MANAGEMENT_API_KEY", | ||
data: { | ||
assets: assets, | ||
items: items | ||
} | ||
environmentId: "KONTENT_AI_ENVIRONMENT_ID", | ||
apiKey: "MANAGEMENT_API_KEY", | ||
data: { | ||
assets: assets, | ||
items: items, | ||
}, | ||
}); | ||
|
2 changes: 1 addition & 1 deletion
2
ts/migrate-from-other-systems/migration_toolkit_map_migrationasset.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
ts/migrate-from-other-systems/migration_toolkit_migrationitem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
ts/migrate-from-other-systems/migration_toolkit_store_mapped_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { | ||
storeAsync, | ||
} from "@kontent-ai-consulting/migration-toolkit"; | ||
import { storeAsync } from "@kontent-ai/migration-toolkit"; | ||
|
||
// Store your mapped data on the filesystem | ||
await storeAsync({ | ||
data: { | ||
assets: migrationAssets, | ||
items: migrationItems | ||
items: migrationItems, | ||
}, | ||
filename: 'core_content.zip', | ||
}); | ||
filename: "core_content.zip", | ||
}); |