2019-02-04 11:24:31 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
2019-06-26 13:17:31 +02:00
|
|
|
export PATH=$Path:/bin:/usr/bin:/usr/local/bin
|
|
|
|
DATE=`date +%d-%m-%y/%H:%M:%S`
|
|
|
|
|
2020-11-17 11:23:03 +01:00
|
|
|
# https://www.mediacurrent.com/blog/memory-management-migrations-drupal-8/
|
|
|
|
|
|
|
|
# migration_loop(){
|
|
|
|
# # Better readability with separation.
|
|
|
|
# echo "========================";
|
|
|
|
# # Get the output of the drush status.
|
|
|
|
# drush_output=$(drush ms | grep $1);
|
|
|
|
#
|
|
|
|
# # Split output string into an array.
|
|
|
|
# output=( $drush_output );
|
|
|
|
#
|
|
|
|
# # Output the status items.
|
|
|
|
# for index in "${!output[@]}"
|
|
|
|
# do
|
|
|
|
# if [ $index == "0" ]
|
|
|
|
# then
|
|
|
|
# echo "Migration: ${output[index]}";
|
|
|
|
# fi
|
|
|
|
# if [ $index == "1" ]
|
|
|
|
# then
|
|
|
|
# echo "Status: ${output[index]}";
|
|
|
|
# fi
|
|
|
|
# if [ $index == "2" ]
|
|
|
|
# then
|
|
|
|
# echo "Total: ${output[index]}";
|
|
|
|
# fi
|
|
|
|
# if [ $index == "3" ]
|
|
|
|
# then
|
|
|
|
# echo "Imported: ${output[index]}";
|
|
|
|
# fi
|
|
|
|
# if [ $index == "4" ]
|
|
|
|
# then
|
|
|
|
# echo "Remaining: ${output[index]}";
|
|
|
|
# fi
|
|
|
|
# done
|
|
|
|
#
|
|
|
|
# # Check if all items were imported.
|
|
|
|
#
|
|
|
|
# if [ "${output[4]}" == "0" ]
|
|
|
|
# then
|
|
|
|
# echo "No items left to import.";
|
|
|
|
# else
|
|
|
|
# echo "There are ${output[4]} remaining ${output[0]} items to be imported.";
|
|
|
|
# echo "Running command: drush mim $1";
|
|
|
|
# echo "...";
|
|
|
|
# # Run the migration until it stops.
|
|
|
|
# drush mim $1;
|
|
|
|
# # Run the check on this migration again.
|
|
|
|
# migration_loop $1;
|
|
|
|
# fi
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
2019-06-26 13:17:31 +02:00
|
|
|
echo -e "* * * * * * * * * * * * * * * *"
|
|
|
|
echo -e "* *"
|
|
|
|
echo -e "* Migration *"
|
|
|
|
echo -e "* *"
|
|
|
|
echo -e "* $DATE *"
|
|
|
|
echo -e "* *"
|
|
|
|
echo -e "* * * * * * * * * * * * * * * *"
|
2019-02-04 11:24:31 +01:00
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating Files"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_allpublicfiles --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_allpublicfiles;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-04 11:24:31 +01:00
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating Taxonomy"
|
|
|
|
echo "Migrating thesaurus"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_thesaurus --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_thesaurus;
|
2019-02-13 20:10:40 +01:00
|
|
|
echo " "
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_thesaurus_i18n --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_thesaurus_i18n;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-04 11:24:31 +01:00
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating tags"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_tags --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_tags;
|
2019-02-13 20:10:40 +01:00
|
|
|
echo " "
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_tags_i18n --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_tags_i18n;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-04 11:24:31 +01:00
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating companies"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_company --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_company;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-04 11:24:31 +01:00
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating showroom"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_taxonomy_term_showroom --update --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_taxonomy_term_showroom;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-05 15:36:36 +01:00
|
|
|
|
2019-04-11 19:01:43 +02:00
|
|
|
echo " "
|
|
|
|
echo "Migrating Users"
|
2019-04-12 01:06:54 +02:00
|
|
|
drush mim d7_users --update --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_users;
|
2019-04-11 19:01:43 +02:00
|
|
|
echo " "
|
|
|
|
drush mim d7_user_profile --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_user_profile;
|
2019-04-11 19:01:43 +02:00
|
|
|
echo " "
|
|
|
|
drush mim d7_uc_roles_license --update --feedback="200"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_uc_roles_license;
|
2019-04-11 19:01:43 +02:00
|
|
|
sleep 5
|
|
|
|
|
2019-02-05 15:36:36 +01:00
|
|
|
echo " "
|
|
|
|
echo "Migrating Nodes"
|
|
|
|
echo "Migrating Materials"
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_node_materiau --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_node_materiau;
|
2019-02-13 20:10:40 +01:00
|
|
|
echo " "
|
2019-02-05 21:43:05 +01:00
|
|
|
drush mim d7_node_materiau_i18n --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_node_materiau_i18n;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "Migrating breves"
|
|
|
|
drush mim d7_node_article --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_node_article;
|
2019-02-13 20:10:40 +01:00
|
|
|
echo " "
|
2019-02-13 20:01:43 +01:00
|
|
|
drush mim d7_node_article_i18n --feedback="100"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_node_article_i18n;
|
2019-02-13 20:01:43 +01:00
|
|
|
sleep 5
|
2019-02-20 15:25:56 +01:00
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "Migrating simplenews"
|
|
|
|
drush mim d7_simplenews_nodes --feedback="200"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_simplenews_nodes;
|
2019-02-20 15:55:53 +01:00
|
|
|
drush mim d7_simplenews_subscribers --update --feedback="1000"
|
2020-11-17 11:23:03 +01:00
|
|
|
# migration_loop d7_simplenews_subscribers;
|
2019-02-20 15:25:56 +01:00
|
|
|
sleep 5
|
2021-03-01 18:50:54 +01:00
|
|
|
|
|
|
|
echo " "
|
|
|
|
echo "Regenerating url aliases for nodes and terms"
|
|
|
|
drush pag all canonical_entities:taxonomy_term
|
|
|
|
drush pag all canonical_entities:node
|
|
|
|
sleep 5
|