diff --git a/admin/admin-menu-and-tabs.php b/admin/admin-menu-and-tabs.php
index 7554b40..eaa028a 100644
--- a/admin/admin-menu-and-tabs.php
+++ b/admin/admin-menu-and-tabs.php
@@ -136,7 +136,8 @@ public static function get_post_type_label( string $post_type ): string {
*/
public static function get_settings(): array {
$defaults = [
- 'enabled' => false,
+ 'enabled' => false,
+ 'include_activity_log' => false,
// Legacy option; UI no longer exposes a single "mode". Capabilities API reports both channels.
'mode' => 'api',
'allowed_items' => [
diff --git a/admin/class-dt-migration-import-ajax.php b/admin/class-dt-migration-import-ajax.php
index 4e910ba..d71d1ef 100644
--- a/admin/class-dt-migration-import-ajax.php
+++ b/admin/class-dt-migration-import-ajax.php
@@ -304,6 +304,18 @@ public function handle_import_batch() : void {
$batch_result['errors'] = array_merge( $batch_result['errors'] ?? [], $pum_result['errors'] );
}
+ if ( ! empty( $settings['include_activity_log'] ) ) {
+ $activity_rows = $rbody['activity_log'] ?? [];
+ $act_result = Disciple_Tools_Migration_Import_Engine::import_activity_log_for_posts(
+ is_array( $activity_rows ) ? $activity_rows : [],
+ $batch_post_ids,
+ $post_type
+ );
+ if ( ! empty( $act_result['errors'] ) ) {
+ $batch_result['errors'] = array_merge( $batch_result['errors'] ?? [], $act_result['errors'] );
+ }
+ }
+
wp_send_json_success( [
'done' => ! $has_more,
'phase' => 'records',
@@ -486,6 +498,18 @@ private function handle_file_mode_batch( string $step, array $settings ) : void
$batch_result['errors'] = array_merge( $batch_result['errors'] ?? [], $pum_result['errors'] );
}
+ if ( ! empty( $settings['include_activity_log'] ) ) {
+ $activity_rows = $payload['activity_log'][ $post_type ] ?? [];
+ $act_result = Disciple_Tools_Migration_Import_Engine::import_activity_log_for_posts(
+ is_array( $activity_rows ) ? $activity_rows : [],
+ $slice_post_ids,
+ $post_type
+ );
+ if ( ! empty( $act_result['errors'] ) ) {
+ $batch_result['errors'] = array_merge( $batch_result['errors'] ?? [], $act_result['errors'] );
+ }
+ }
+
wp_send_json_success( [
'done' => ! $has_more,
'phase' => 'records',
diff --git a/admin/class-dt-migration-tab-import.php b/admin/class-dt-migration-tab-import.php
index edd6505..0a18c78 100644
--- a/admin/class-dt-migration-tab-import.php
+++ b/admin/class-dt-migration-tab-import.php
@@ -49,6 +49,13 @@ class Disciple_Tools_Migration_Tab_Import {
*/
private $import_preview_user_count = 0;
+ /**
+ * Whether the previewed export includes activity log rows (source package / Server A).
+ *
+ * @var bool
+ */
+ private $import_preview_export_include_activity_log = false;
+
/**
* Which import UI produced the current preview: 'api' or 'file'.
*
@@ -322,6 +329,7 @@ class="dt-migration-setting-checkbox"
|
+ render_import_preview_activity_settings_row(); ?>
@@ -336,6 +344,7 @@ class="dt-migration-setting-checkbox"
|
|
|
+ |
@@ -360,12 +369,27 @@ class="dt-migration-record-checkbox"
|
|
|
+
+ import_preview_export_include_activity_log ) {
+ $ac = isset( $record_data['activity_log_count'] ) ? (int) $record_data['activity_log_count'] : 0;
+ echo esc_html( number_format_i18n( $ac ) );
+ } else {
+ echo '—';
+ }
+ ?>
+ |
+ import_preview_export_include_activity_log && empty( $settings['include_activity_log'] ) ) : ?>
+
+
+
+