diff --git a/core/modules/config/src/Form/ConfigSingleImportForm.php b/core/modules/config/src/Form/ConfigSingleImportForm.php
index 9f9a8d9..c9fa73e 100644
--- a/core/modules/config/src/Form/ConfigSingleImportForm.php
+++ b/core/modules/config/src/Form/ConfigSingleImportForm.php
@@ -4,6 +4,7 @@
 
 use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
 use Drupal\config\StorageReplaceDataWrapper;
+use Drupal\Core\Batch\BatchBuilder;
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Config\ConfigImporterException;
 use Drupal\Core\Config\ConfigManagerInterface;
@@ -400,19 +401,16 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     else {
       try {
         $sync_steps = $config_importer->initialize();
-        $batch = [
-          'operations' => [],
-          'finished' => [ConfigSync::class, 'finishBatch'],
-          'title' => $this->t('Importing configuration'),
-          'init_message' => $this->t('Starting configuration import.'),
-          'progress_message' => $this->t('Completed @current step of @total.'),
-          'error_message' => $this->t('Configuration import has encountered an error.'),
-        ];
+        $batch_builder = (new BatchBuilder())
+            ->setTitle($this->t('Importing configuration'))
+            ->setFinishCallback([ConfigSync::class, 'finishBatch'])
+            ->setInitMessage($this->t('Starting configuration import.'))
+            ->setProgressMessage($this->t('Completed @current step of @total.'))
+            ->setErrorMessage($this->t('Configuration import has encountered an error.'));
         foreach ($sync_steps as $sync_step) {
-          $batch['operations'][] = [[ConfigSync::class, 'processBatch'], [$config_importer, $sync_step]];
+            $batch_builder ->addOperation('operations',[[ConfigSync::class, 'processBatch'], [$config_importer, $sync_step]]);
         }
-
-        batch_set($batch);
+        batch_set($batch_builder->toArray());
       }
       catch (ConfigImporterException $e) {
         // There are validation errors.
diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php
index 2813099..c798d4c 100644
--- a/core/modules/config/src/Form/ConfigSync.php
+++ b/core/modules/config/src/Form/ConfigSync.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\config\Form;
 
+use Drupal\Core\Batch\BatchBuilder;
 use Drupal\Core\Config\ConfigImporterException;
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Config\TypedConfigManagerInterface;
@@ -335,20 +336,17 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     else {
       try {
         $sync_steps = $config_importer->initialize();
-        $batch = [
-          'operations' => [],
-          'finished' => [get_class($this), 'finishBatch'],
-          'title' => t('Synchronizing configuration'),
-          'init_message' => t('Starting configuration synchronization.'),
-          'progress_message' => t('Completed step @current of @total.'),
-          'error_message' => t('Configuration synchronization has encountered an error.'),
-          'file' => __DIR__ . '/../../config.admin.inc',
-        ];
+        $batch_builder = (new BatchBuilder())
+            ->setTitle($this->t('Synchronizing configuration'))
+            ->setFinishCallback([ConfigSync::class, 'finishBatch'])
+            ->setInitMessage($this->t('Starting configuration synchronization.'))
+            ->setProgressMessage($this->t('Completed step @current of @total.'))
+            ->setErrorMessage($this->t('Configuration synchronization has encountered an error.'))
+            ->setFile(__DIR__ . '/../../config.admin.inc');
         foreach ($sync_steps as $sync_step) {
-          $batch['operations'][] = [[get_class($this), 'processBatch'], [$config_importer, $sync_step]];
+            $batch_builder ->addOperation('operations',[[get_class($this), 'processBatch'], [$config_importer, $sync_step]]);
         }
-
-        batch_set($batch);
+        batch_set($batch_builder->toArray());
       }
       catch (ConfigImporterException $e) {
         // There are validation errors.
