|
@@ -600,15 +600,6 @@ export class G2GTransferReceiverService implements Receiver {
|
|
|
return importSettingsMap;
|
|
return importSettingsMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private async processImportWithPrePostProcess(
|
|
|
|
|
- collections: string[],
|
|
|
|
|
- importSettingsMap: { [key: string]: ImportSettings; },
|
|
|
|
|
- ): Promise<void> {
|
|
|
|
|
- await this.crowi.importService.updateIsV5CompatibleBeforeImport(collections);
|
|
|
|
|
- await this.crowi.importService.import(collections, importSettingsMap);
|
|
|
|
|
- await this.crowi.importService.normalizeAllPublicPagesAfterImport(collections);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public async importCollections(
|
|
public async importCollections(
|
|
|
collections: string[],
|
|
collections: string[],
|
|
|
importSettingsMap: { [key: string]: ImportSettings; },
|
|
importSettingsMap: { [key: string]: ImportSettings; },
|
|
@@ -623,7 +614,7 @@ export class G2GTransferReceiverService implements Receiver {
|
|
|
const fileUploadConfigs = await this.getFileUploadConfigs();
|
|
const fileUploadConfigs = await this.getFileUploadConfigs();
|
|
|
|
|
|
|
|
// import mongo collections(overwrites file uplaod configs)
|
|
// import mongo collections(overwrites file uplaod configs)
|
|
|
- await this.processImportWithPrePostProcess(collections, importSettingsMap);
|
|
|
|
|
|
|
+ await importService.import(collections, importSettingsMap);
|
|
|
|
|
|
|
|
// restore file upload config from cache
|
|
// restore file upload config from cache
|
|
|
await configManager.removeConfigsInTheSameNamespace('crowi', UPLOAD_CONFIG_KEYS);
|
|
await configManager.removeConfigsInTheSameNamespace('crowi', UPLOAD_CONFIG_KEYS);
|
|
@@ -631,7 +622,7 @@ export class G2GTransferReceiverService implements Receiver {
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
// import mongo collections(overwrites file uplaod configs)
|
|
// import mongo collections(overwrites file uplaod configs)
|
|
|
- await this.processImportWithPrePostProcess(collections, importSettingsMap);
|
|
|
|
|
|
|
+ await importService.import(collections, importSettingsMap);
|
|
|
|
|
|
|
|
// update file upload config
|
|
// update file upload config
|
|
|
await configManager.updateConfigsInTheSameNamespace('crowi', sourceGROWIUploadConfigs);
|
|
await configManager.updateConfigsInTheSameNamespace('crowi', sourceGROWIUploadConfigs);
|