migrate script resets the migration before migrate

This commit is contained in:
Bachir Soussi Chiadmi 2021-03-01 23:40:58 +01:00
parent b8da8b516b
commit a4104882fe
1 changed files with 25 additions and 68 deletions

View File

@ -5,57 +5,6 @@ DATE=`date +%d-%m-%y/%H:%M:%S`
# https://www.mediacurrent.com/blog/memory-management-migrations-drupal-8/ # 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
# }
echo -e "* * * * * * * * * * * * * * * *" echo -e "* * * * * * * * * * * * * * * *"
echo -e "* *" echo -e "* *"
echo -e "* Migration *" echo -e "* Migration *"
@ -64,84 +13,92 @@ echo -e "* $DATE *"
echo -e "* *" echo -e "* *"
echo -e "* * * * * * * * * * * * * * * *" echo -e "* * * * * * * * * * * * * * * *"
echo " "
echo "Reseting migrations states"
drush mrs d7_allpublicfiles
drush mrs d7_taxonomy_term_thesaurus
drush mrs d7_taxonomy_term_thesaurus_i18n
drush mrs d7_taxonomy_term_tags
drush mrs d7_taxonomy_term_tags_i18n
drush mrs d7_taxonomy_term_company
drush mrs d7_taxonomy_term_showroom
drush mrs d7_users
drush mrs d7_user_profile
drush mrs d7_uc_roles_license
drush mrs d7_node_materiau
drush mrs d7_node_materiau_i18n
drush mrs d7_node_article
drush mrs d7_node_article_i18n
drush mrs d7_simplenews_nodes
drush mrs d7_simplenews_subscribers
drush mrs d7_flaglists
drush mrs d7_flaglistitems
sleep 5
echo " " echo " "
echo "Migrating Files" echo "Migrating Files"
drush mim d7_allpublicfiles --feedback="1000" drush mim d7_allpublicfiles --feedback="1000"
# migration_loop d7_allpublicfiles;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating Taxonomy" echo "Migrating Taxonomy"
echo "Migrating thesaurus" echo "Migrating thesaurus"
drush mim d7_taxonomy_term_thesaurus --update --feedback="100" drush mim d7_taxonomy_term_thesaurus --update --feedback="100"
# migration_loop d7_taxonomy_term_thesaurus;
echo " " echo " "
drush mim d7_taxonomy_term_thesaurus_i18n --update --feedback="100" drush mim d7_taxonomy_term_thesaurus_i18n --update --feedback="100"
# migration_loop d7_taxonomy_term_thesaurus_i18n;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating tags" echo "Migrating tags"
drush mim d7_taxonomy_term_tags --update --feedback="100" drush mim d7_taxonomy_term_tags --update --feedback="100"
# migration_loop d7_taxonomy_term_tags;
echo " " echo " "
drush mim d7_taxonomy_term_tags_i18n --update --feedback="100" drush mim d7_taxonomy_term_tags_i18n --update --feedback="100"
# migration_loop d7_taxonomy_term_tags_i18n;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating companies" echo "Migrating companies"
drush mim d7_taxonomy_term_company --update --feedback="100" drush mim d7_taxonomy_term_company --update --feedback="100"
# migration_loop d7_taxonomy_term_company;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating showroom" echo "Migrating showroom"
drush mim d7_taxonomy_term_showroom --update --feedback="100" drush mim d7_taxonomy_term_showroom --update --feedback="100"
# migration_loop d7_taxonomy_term_showroom;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating Users" echo "Migrating Users"
drush mim d7_users --update --feedback="1000" drush mim d7_users --update --feedback="1000"
# migration_loop d7_users;
echo " " echo " "
drush mim d7_user_profile --feedback="1000" drush mim d7_user_profile --feedback="1000"
# migration_loop d7_user_profile;
echo " " echo " "
drush mim d7_uc_roles_license --update --feedback="200" drush mim d7_uc_roles_license --update --feedback="200"
# migration_loop d7_uc_roles_license;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating Nodes" echo "Migrating Nodes"
echo "Migrating Materials" echo "Migrating Materials"
drush mim d7_node_materiau --feedback="1000" drush mim d7_node_materiau --feedback="1000"
# migration_loop d7_node_materiau;
echo " " echo " "
drush mim d7_node_materiau_i18n --feedback="1000" drush mim d7_node_materiau_i18n --feedback="1000"
# migration_loop d7_node_materiau_i18n;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating breves" echo "Migrating breves"
drush mim d7_node_article --feedback="100" drush mim d7_node_article --feedback="100"
# migration_loop d7_node_article;
echo " " echo " "
drush mim d7_node_article_i18n --feedback="100" drush mim d7_node_article_i18n --feedback="100"
# migration_loop d7_node_article_i18n;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating simplenews" echo "Migrating simplenews"
drush mim d7_simplenews_nodes --feedback="200" drush mim d7_simplenews_nodes --feedback="200"
# migration_loop d7_simplenews_nodes;
drush mim d7_simplenews_subscribers --update --feedback="1000" drush mim d7_simplenews_subscribers --update --feedback="1000"
# migration_loop d7_simplenews_subscribers;
sleep 5 sleep 5
echo " " echo " "
echo "Migrating flalists" echo "Migrating flaglists"
drush mim d7_flaglists --feedback="200" drush mim d7_flaglists --feedback="200"
echo " " echo " "
drush mim d7_flaglistitems --feedback="200" drush mim d7_flaglistitems --feedback="200"