|
|
@@ -184,10 +184,10 @@ class ImportService {
|
|
|
|
|
|
const isV5Compatible = this.crowi.configManager.getConfig('crowi', 'app:isV5Compatible');
|
|
|
const isImportPagesCollection = collections.includes('pages');
|
|
|
- const shouldMigratePages = isV5Compatible && isImportPagesCollection;
|
|
|
+ const shouldNormalizePages = isV5Compatible && isImportPagesCollection;
|
|
|
|
|
|
// set isV5Compatible to false
|
|
|
- if (shouldMigratePages) await this.crowi.configManager.updateConfigsInTheSameNamespace('crowi', { 'app:isV5Compatible': false });
|
|
|
+ if (shouldNormalizePages) await this.crowi.configManager.updateConfigsInTheSameNamespace('crowi', { 'app:isV5Compatible': false });
|
|
|
|
|
|
// process serially so as not to waste memory
|
|
|
const promises = collections.map((collectionName) => {
|
|
|
@@ -206,8 +206,8 @@ class ImportService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // run v5InitialMigration
|
|
|
- if (shouldMigratePages) await this.crowi.pageService.v5InitialMigration();
|
|
|
+ // run normalizeAllPublicPages
|
|
|
+ if (shouldNormalizePages) await this.crowi.pageService.normalizeAllPublicPages();
|
|
|
|
|
|
this.currentProgressingStatus = null;
|
|
|
this.emitTerminateEvent();
|
|
|
@@ -343,6 +343,8 @@ class ImportService {
|
|
|
|
|
|
// upsert
|
|
|
switch (collectionName) {
|
|
|
+ case 'pages':
|
|
|
+ return bulk.find({ path: document.path }).upsert().replaceOne(document);
|
|
|
default:
|
|
|
return bulk.find({ _id: document._id }).upsert().replaceOne(document);
|
|
|
}
|