migrateContent example



  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installEntitySchema('comment');
    $this->installEntitySchema('taxonomy_term');
    $this->installSchema('comment', ['comment_entity_statistics']);
    $this->installSchema('node', ['node_access']);
    $this->migrateContent();
    $this->executeMigrations([
      'language',
      'd7_node_type',
      'd7_language_content_settings',
      'd7_node_translation',
      'd7_comment_field',
      'd7_comment_field_instance',
      'd7_comment_entity_display',
      'd7_comment_entity_form_display',
      'd7_taxonomy_vocabulary',
      'd7_field',
      

  protected function setUp(): void {
    parent::setUp();

    $this->installEntitySchema('node');
    $this->installEntitySchema('comment');
    $this->installSchema('comment', ['comment_entity_statistics']);
    $this->installSchema('node', ['node_access']);
    $this->installConfig(['comment']);

    $this->migrateContent();
    $this->executeMigrations([
      'language',
      'd6_language_content_settings',
      'd6_node',
      'd6_node_translation',
      'd6_comment_type',
      'd6_comment_field',
      'd6_comment_field_instance',
      'd6_comment_entity_display',
      'd6_comment_entity_form_display',
      'd6_comment',
    ]);

  protected static $modules = ['book', 'node', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installSchema('book', ['book']);
    $this->installSchema('node', ['node_access']);
    $this->migrateContent();
    $this->executeMigrations(['d6_node', 'd6_book']);
  }

  /** * Tests the Drupal 6 book structure to Drupal 8 migration. */
  public function testBook() {
    $nodes = Node::loadMultiple([4, 5, 6, 7, 8]);
    $this->assertSame('4', $nodes[4]->book['bid']);
    $this->assertSame('0', $nodes[4]->book['pid']);

    

      $file->setPermanent();
      $file->enforceIsNew();
      file_put_contents($file->getFileUri(), 'hello world');

      // Save it, inserting a new record.       $file->save();
      $id_mappings['d6_file'][] = [[$i][$i]];
    }
    $this->prepareMigrations($id_mappings);

    $this->migrateContent(['translations']);
    // Since we are only testing a subset of the file migration, do not check     // that the full file migration has been run.     $migration = $this->getMigration('d6_upload');
    $migration->set('requirements', []);
    $this->executeMigration($migration);
  }

  /** * Tests upload migration from Drupal 6 to Drupal 8. */
  public function testUpload() {
    
/** * {@inheritdoc} */
  protected static $modules = ['taxonomy', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installSchema('node', ['node_access']);
    $this->migrateContent(['revisions']);
    $this->migrateTaxonomy();
    $this->executeMigrations(['d6_term_node', 'd6_term_node_revision']);
  }

  /** * Tests the Drupal 6 term-node revision association to Drupal 8 migration. */
  public function testTermRevisionNode() {
    $node = \Drupal::entityTypeManager()->getStorage('node')->loadRevision(2001);
    $this->assertCount(2, $node->field_vocabulary_3_i_2_);
    $this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);
    
$this->installEntitySchema('node');
    $this->installConfig(['node']);
    $this->installSchema('node', ['node_access']);
    $this->installSchema('system', ['sequences']);

    $this->executeMigration('language');
    $this->executeMigration('d6_node_settings');
    $this->migrateUsers(FALSE);
    $this->migrateFields();
    $this->migrateTaxonomy();
    $this->migrateContent(['translations']);

    // This is a base plugin id and we want to run all derivatives.     $this->executeMigrations([
      'd6_term_node',
      'd6_term_node_translation',
    ]);
  }

  /** * Tests the Drupal 6 term-node association to Drupal 8 migration. */
  
'menu_ui',
    'menu_link_content',
    'language',
    'content_translation',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateContent();
    $this->setUpCurrentUser();
    $this->installEntitySchema('menu_link_content');
    $this->executeMigrations([
      'language',
      'd6_menu',
      'd6_menu_links',
      'd6_menu_links_translation',
    ]);
  }

  /** * Tests migration of menu links. */
/** * {@inheritdoc} */
  protected static $modules = ['taxonomy', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->installSchema('node', ['node_access']);
    $this->migrateContent();
    $this->migrateTaxonomy();
  }

  /** * Tests the Drupal 6 term-node association to Drupal 8 migration. */
  public function testTermNode() {
    // This is a base plugin id and we want to run all derivatives.     $this->executeMigrations(['d6_term_node']);

    $this->container->get('entity_type.manager')
      
/** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->installEntitySchema('comment');
    $this->installSchema('comment', ['comment_entity_statistics']);
    $this->installSchema('forum', ['forum', 'forum_index']);
    $this->installConfig(['comment', 'forum']);
    $this->migrateContent();
    $this->migrateTaxonomy();
    $this->executeMigrations([
      'd6_comment_type',
      'd6_comment_field',
      'd6_comment_field_instance',
      'd6_comment_entity_display',
      'd6_comment_entity_form_display',
      'd6_comment',
      'd6_term_node',
    ]);
  }

  
Home | Imprint | This part of the site doesn't use cookies.