JezK
Edit File: mwp-full.sh.1
#!/bin/bash/ echo -e "\e[36m--##### SCRIPT STARTING AT:" pwd echo -e "\e[0m" echo -e "\e[32m--PLEASE NOTE! -- That this is ## PART-1 ## Script" echo -e "Which will INSTALL WORDPRESS and AIO Plugin for manual FILE UPLOAD. " echo -e "CASES: When our IP is blocked or Domain already pointing to us. " echo -e "\e[0m" echo -e "--Please insert the following details: " sleep 1 echo -e "\e[91m--INSERT MIGRATION ID:" echo -e "\e[0m" echo -e "\e[33mThis ID will allow to use same script for more than 1 website." echo -e "The DATABASE MUST BE CREATED with the same ID like: username_migration1 and etc." echo -e "ID Number must match the number in database name : username_migration[ID] " echo -e "If you will enter ID = 10 , The database must be : ( u123456789_migration10 ) " echo -e "\e[0m" read migID sleep 1 echo -e "\e[91m--Enter DOMAIN NAME in which you want to migrate:" echo -e "\e[0m" read userDomain echo -e "\e[91m--Enter DATABASE PASSWORD:" echo -e "\e[0m" read dbPass echo -e "\e[32m--Details have been RECORDED... Starting WP Installation... " echo -e "\e[0m" sleep 2 cd domains/${userDomain}/public_html/ echo -e "\e[36m--##### WORDPRESS IS BEING INSTALLED IN:" pwd echo -e "\e[0m" wp core download wp core config --dbhost=localhost --dbname=${USER}_migration${migID} --dbuser=${USER}_migration${migID} --dbpass=${dbPass} wp core install --url=${userDomain} --title="Website migrated by Hostinger" --admin_name=admin --admin_password=Support123456789 --admin_email=hostingerwpmigrations@gmail.com cd wp-content/plugins/ echo -e "\e[36m--##### GOING TO INSTALL PLUGIN IN:" pwd echo -e "\e[0m" sleep 1 wp plugin install all-in-one-wp-migration wp plugin install http://153.92.5.12/aio.zip echo -e "\e[36m--##### ACTIVATING WP AIO PLUGIN:" echo -e "\e[0m" wp plugin activate all-in-one-wp-migration wp plugin activate all-in-one-wp-migration-unlimited-extension cd .. echo -e "\e[36m--##### GOING TO DOWNLOAD AI1WM Folder and files at:" pwd echo -e "\e[0m" sleep 1 wget http://153.92.5.12/ai1wm-backups.tar.gz tar -zxvf ai1wm-backups.tar.gz rm ai1wm-backups.tar.gz cd .. echo -e "\e[36m--##### GOING TO DOWNLOAD DEFAULT .HTACCESS at:" pwd echo -e "\e[0m" sleep 1 wget http://153.92.5.12/ht.tar.gz tar -zxvf ht.tar.gz rm ht.tar.gz echo -e "\e[32m--## PART-1 ## Script have been completed." echo -e "--Wordpress have been installed with the following details: " echo -e "\e[0m" echo -e "\e[33m" echo -e "--DOMAIN: ${userDomain} " echo -e "--DATABASE and USERNAME: ${USER}_migration${migID}" echo -e "--WP ADMIN USERNAME: admin " echo -e "--WP ADMIN PASSWORD: Support123456789" echo -e "--WP ADMIN EMAIL: hostingerwpmigrations@gmail.com" echo -e "\e[0m" echo -e "\e[32m--WP Have been installed and ready now." echo -e "\e[0m" sleep 1 echo -e "\e[32m--Going back to ROOT:" echo -e "\e[0m" cd ../../.. echo -e "\e[36m--##### YOU ARE NOW HERE:" pwd echo -e "\e[0m" echo -e "\e[91m-- If you want to Continue with RESTORATION Make sure the .WPRESS File is uploaded. " echo -e "\e[0m" echo -e "\e[33m" while true; do read -p "Would you like to run RESTORATION PROCESS? Y/y/Yes/yes or N/n/No/no : " yn case $yn in [Yy]* ) make install; break;; [Nn]* ) exit;; * ) echo "Please answer yes or no.";; esac done echo -e "\e[0m" echo -e "\e[32m--PLEASE NOTE! -- That this is ## PART-2 ## Script" echo -e "Which will RESTORE WORDPRESS FROM .wpress FILE using AIO Plugin. " echo -e "THE .WPRESS File must be already uploaded in root destination: " echo -e "For example: /home/u123456789/yourfile.wpress " echo -e "\e[0m" echo -e "\e[91m--INSERT FULL WPRESS FILE NAME, EXAMPLE ( domain.com-20191212-225143-374.wpress ) :" echo -e "\e[0m" echo -e "\e[33m###### IF THE FILE IS NOT YET UPLOADED DO SO! Once done, insert .wpress file name and hit ENTER! ######" read userWPRESS echo -e "\e[0m" sleep 1 echo -e "\e[36m--##### MOVING .WPRESS FILE TO: /home/${USER}/domains/${userDomain}/public_html/wp-content/ai1wm-backups :" echo -e "\e[0m" mv ${userWPRESS} domains/${userDomain}/public_html/wp-content/ai1wm-backups cd domains/${userDomain}/public_html/wp-content/ai1wm-backups echo -e "\e[36m--##### Going to BACKUP's folder at:" pwd echo -e "\e[0m" echo -e "\e[32m--STARTING restore..." wp ai1wm restore ${userWPRESS} wp rewrite flush sleep 1 echo -e "Restore have been completed!" echo -e "\e[0m" echo -e "\e[36m--##### Going to remove AIO Plugin at:" cd ../plugins pwd echo -e "\e[0m" rm -rf all-in-one-wp-migration rm -rf all-in-one-wp-migration-unlimited-extension sleep 1 echo -e "\e[32m--Plugin removed..." echo -e "\e[36m--##### REMOVING MYSELF and EXITING..." echo -e "\e[0m" sleep 1 cd rm -- "$0"