RESSOURCES
- http://drupal.org/project/drupal
- http://drupal.org/project/migrate_plus
- http://www.drupal.org/project/console
MIGRATE IN DRUPAL 8
Migrate is now included in the Drupal core for making the upgrade path from 6.x and 7.x versions to Drupal 8.
Drupal 8 has two new modules :
Migrate: « Handles migrations »
Migrate Drupal : « Contains migrations from older Drupal versions. »
None of these module have a User Interface.
« Migrate » contains the core framework classes, the destination, source and process plugins schemas and definitions, and at last the migration config entity schema and definition.
« Migrate Drupal » contains implementations of destination, sources and process plugins for Drupal 6 and 7 you can use it or extend it, it’s ready to use. But this module doesn’t contain the configuration to migrate all you datas from your older Drupal site to Drupal 8.
The core provides templates of migration configuration entity that are located under each module of the core that needs one, under a folder named ‘migration_templates’ to find all the templates you can use this command in your Drupal 8 site:
find ./ -type d -name ‘migration_templates‘ |
To make a Drupal core to core migration, you will find all the infos here : https://www.Drupal.org/node/2257723 there is an UI in progress for upgrading.
A MIGRATION FRAMEWORK
Let have a look at each big piece of the migration framework :
SOURCE PLUGINS
Drupal provides an interface and base classes for the migration source plugin :
- SqlBase : Base class for SQL source, you need to extend this class to use it in your migration.
- SourcePluginBase : Base class for every custom source plugin.
- MenuLink: For D6/D7 menu links.
- EmptySource (id:empty): Plugin source that returns an empty row.
- …
PROCESS PLUGINS
There is the equivalent of the D7 MigrateFieldHandler but this is not reduced to fields or to a particular field type.
Its purpose is to transform a raw value into something acceptable by your new site schema.
The method transform() of the plugin is in charge of transforming your $value or skipping the entire row if needed.
If the source property has multiple values, the transform() will happen on each one.
<?php | |
public function transform($value, MigrateExecutableInterface $migrate_executable, | |
Row $row, $destination_property); |
Drupal provides migration process plugin into each module of the core that needs it (for the core upgrade),
To find out which one and where it is located you can use this command :
find ./ -type d -name ‘process‘ |
DESTINATION PLUGINS
Destination plugins are the classes that handle where your data are saved in the new Drupal 8 sites schemas.
Drupal provides a lot of useful destination classes :
- DestinationBase : Base class for migrate destination classes.
- Entity (id: entity) : Base class for entity destinations.
- Config (id: config) : Class for importing configuration entities.
- EntityBaseFieldOverride (id: entity:base_field_override): Class for importing base field.
- EntityConfigBase : Base class for importing configuration entities.
- EntityImageStyle (id: entity:image_style): Class for importing image_style.
- EntityContentBase (id: entity:%entity_type): The destination class for all content entities lacking a specific class.
- EntityNodeType: (id: entity:node_type): A class for migrate node type.
- EntityFile (id: entity:file): Class for migrate files.
- EntityFieldInstance: Class for migrate field instance.
- EntityFieldStorageConfig: Class for migrate field storage.
- EntityRevision, EntityViewMode, EntityUser, Book…
- And so more…
find ./ -type d -name ‘destination‘ |
click here 2501
click here 2502
click here 2503
click here 2504
click here 2505
click here 2506
click here 2507
click here 2508
click here 2509
click here 2510
click here 2511
click here 2512
click here 2513
click here 2514
click here 2515
click here 2516
click here 2517
click here 2518
click here 2519
click here 2520
click here 2521
click here 2522
click here 2523
click here 2524
click here 2525
click here 2526
click here 2527
click here 2528
click here 2529
click here 2530
click here 2531
click here 2532
click here 2533
click here 2534
click here 2535
click here 2536
click here 2537
click here 2538
click here 2539
click here 2540
click here 2541
click here 2542
click here 2543
click here 2544
click here 2545
click here 2546
click here 2547
click here 2548
click here 2549
click here 2550
click here 2551
click here 2552
click here 2553
click here 2554
click here 2555
click here 2556
click here 2557
click here 2558
click here 2559
click here 2560
click here 2561
click here 2562
click here 2563
click here 2564
click here 2565
click here 2566
click here 2567
click here 2568
click here 2569
click here 2570
click here 2571
click here 2572
click here 2573
click here 2574
click here 2575
click here 2576
click here 2577
click here 2578
click here 2579
click here 2580
click here 2581
click here 2582
click here 2583
click here 2584
click here 2585
click here 2586
click here 2587
click here 2588
click here 2589
click here 2590
click here 2591
click here 2592
click here 2593
click here 2594
click here 2595
click here 2596
click here 2597
click here 2598
click here 2599
click here 2600
click here 2601
click here 2602
click here 2603
click here 2604
click here 2605
click here 2606
click here 2607
click here 2608
click here 2609
click here 2610
click here 2611
click here 2612
click here 2613
click here 2614
click here 2615
click here 2616
click here 2617
click here 2618
click here 2619
click here 2620
click here 2621
click here 2622
click here 2623
click here 2624
click here 2625
click here 2626
click here 2627
click here 2628
click here 2629
click here 2630
click here 2631
click here 2632
click here 2633
click here 2634
click here 2635
click here 2636
click here 2637
click here 2638
click here 2639
click here 2640
click here 2641
click here 2642
click here 2643
click here 2644
click here 2645
click here 2646
click here 2647
click here 2648
click here 2649
click here 2650
click here 2651
click here 2652
click here 2653
click here 2654
click here 2655
click here 2656
click here 2657
click here 2658
click here 2659
click here 2660
click here 2661
click here 2662
click here 2663
click here 2664
click here 2665
click here 2666
click here 2667
click here 2668
click here 2669
click here 2670
click here 2671
click here 2672
click here 2673
click here 2674
click here 2675
click here 2676
click here 2677
click here 2678
click here 2679
click here 2680
click here 2681
click here 2682
click here 2683
click here 2684
click here 2685
click here 2686
click here 2687
click here 2688
click here 2689
click here 2690
click here 2691
click here 2692
click here 2693
click here 2694
click here 2695
click here 2696
click here 2697
click here 2698
click here 2699
click here 2700
click here 2701
click here 2702
click here 2703
click here 2704
click here 2705
click here 2706
click here 2707
click here 2708
click here 2709
click here 2710
click here 2711
click here 2712
click here 2713
click here 2714
click here 2715
click here 2716
click here 2717
click here 2718
click here 2719
click here 2720
click here 2721
click here 2722
click here 2723
click here 2724
click here 2725
click here 2726
click here 2727
click here 2728
click here 2729
click here 2730
click here 2731
click here 2732
click here 2733
click here 2734
click here 2735
click here 2736
click here 2737
click here 2738
click here 2739
click here 2740
click here 2741
click here 2742
click here 2743
click here 2744
click here 2745
click here 2746
click here 2747
click here 2748
click here 2749
click here 2750
click here 2751
click here 2752
click here 2753
click here 2754
click here 2755
click here 2756
click here 2757
click here 2758
click here 2759
click here 2760
click here 2761
click here 2762
click here 2763
click here 2764
click here 2765
click here 2766
click here 2767
click here 2768
click here 2769
click here 2770
click here 2771
click here 2772
click here 2773
click here 2774
click here 2775
click here 2776
click here 2777
click here 2778
click here 2779
click here 2780
click here 2781
click here 2782
click here 2783
click here 2784
click here 2785
click here 2786
click here 2787
click here 2788
click here 2789
click here 2790
click here 2791
click here 2792
click here 2793
click here 2794
click here 2795
click here 2796
click here 2797
click here 2798
click here 2799
click here 2800
click here 2801
click here 2802
click here 2803
click here 2804
click here 2805
click here 2806
click here 2807
click here 2808
click here 2809
click here 2810
click here 2811
click here 2812
click here 2813
click here 2814
click here 2815
click here 2816
click here 2817
click here 2818
click here 2819
click here 2820
click here 2821
click here 2822
click here 2823
click here 2824
click here 2825
click here 2826
click here 2827
click here 2828
click here 2829
click here 2830
click here 2831
click here 2832
click here 2833
click here 2834
click here 2835
click here 2836
click here 2837
click here 2838
click here 2839
click here 2840
click here 2841
click here 2842
click here 2843
click here 2844
click here 2845
click here 2846
click here 2847
click here 2848
click here 2849
click here 2850
click here 2851
click here 2852
click here 2853
click here 2854
click here 2855
click here 2856
click here 2857
click here 2858
click here 2859
click here 2860
click here 2861
click here 2862
click here 2863
click here 2864
click here 2865
click here 2866
click here 2867
click here 2868
click here 2869
click here 2870
click here 2871
click here 2872
click here 2873
click here 2874
click here 2875
click here 2876
click here 2877
click here 2878
click here 2879
click here 2880
click here 2881
click here 2882
click here 2883
click here 2884
click here 2885
click here 2886
click here 2887
click here 2888
click here 2889
click here 2890
click here 2891
click here 2892
click here 2893
click here 2894
click here 2895
click here 2896
click here 2897
click here 2898
click here 2899
click here 2900
click here 2901
click here 2902
click here 2903
click here 2904
click here 2905
click here 2906
click here 2907
click here 2908
click here 2909
click here 2910
click here 2911
click here 2912
click here 2913
click here 2914
click here 2915
click here 2916
click here 2917
click here 2918
click here 2919
click here 2920
click here 2921
click here 2922
click here 2923
click here 2924
click here 2925
click here 2926
click here 2927
click here 2928
click here 2929
click here 2930
click here 2931
click here 2932
click here 2933
click here 2934
click here 2935
click here 2936
click here 2937
click here 2938
click here 2939
click here 2940
click here 2941
click here 2942
click here 2943
click here 2944
click here 2945
click here 2946
click here 2947
click here 2948
click here 2949
click here 2950
click here 2951
click here 2952
click here 2953
click here 2954
click here 2955
click here 2956
click here 2957
click here 2958
click here 2959
click here 2960
click here 2961
click here 2962
click here 2963
click here 2964
click here 2965
click here 2966
click here 2967
click here 2968
click here 2969
click here 2970
click here 2971
click here 2972
click here 2973
click here 2974
click here 2975
click here 2976
click here 2977
click here 2978
click here 2979
click here 2980
click here 2981
click here 2982
click here 2983
click here 2984
click here 2985
click here 2986
click here 2987
click here 2988
click here 2989
click here 2990
click here 2991
click here 2992
click here 2993
click here 2994
click here 2995
click here 2996
click here 2997
click here 2998
click here 2999
click here 3000