- Issue created by @marc.bau
- 🇮🇳India mdsohaib4242
A more efficient approach would be to proceed with the migration from Drupal 7 to Drupal 10 as it is. Once the migration is complete, you can create a new "telephone" field in Drupal 10 and then transfer the data from the old field to the new one.
For example, if your content type is "article," and your existing field is `field_old` while the new telephone field is `field_new`, you can use a script to copy all the data.
$batch_size = 50; $nids = \Drupal::entityQuery('node') ->condition('type', 'article') ->execute(); $nids_batches = array_chunk($nids, $batch_size); foreach ($nids_batches as $batch) { $article_nodes = \Drupal\node\Entity\Node::loadMultiple($batch); foreach ($article_nodes as $article_node) { if (!$article_node->get('field_old')->isEmpty()) { $article_node->set('field_new', $article_node->get('field_old')->getValue()); $article_node->save(); } } }