I wanted to make process of wordpress site migration automate everything works fine but i am unable to import complete site from remote to local.Might be something wrong in code, any help will be appreciated.

//require_once "cli.php";
$output = shell_exec("wp core download");
if($output == true){
    echo "Wordpress Downloaded.";
    shell_exec('wp config create --dbname=db_fine --dbuser=root --dbpass="" ');
    echo "Config Created.";
    shell_exec('wp db create');
    echo "Database Created.";
    shell_exec('wp core install --url=http://localhost/automate --title=Test --admin_user=admin --admin_password=admin@123 --admin_email=aghanizaheer@gmail.com');
    echo "Site Installed Successfully.";
    shell_exec("wp theme install http://test.nitgreen.com/wp-content/themes/test.zip --activate");
    echo "Theme Installed.";

    shell_exec("wp plugin install wordpress-importer cmb2 contact-form-7 jetpack mailchimp-for-wp recent-posts-widget-extended redux-framework woocommerce woocommerce-gateway-paypal-express-checkout woocommerce-services wp-fastest-cache http://yovala.nitgreen.com/plugin-3.zip http://yovala.nitgreen.com/plugin-1.zip http://yovala.nitgreen.com/plugin-2.zip http://yovala.nitgreen.com/plugin-3.zip --activate");

    echo "Plugin Install and Activated";

    shell_exec("curl -O http://yovala.nitgreen.com/yovala.wordpress.2018-02-24.xml ");
    shell_exec("wp import yovala.wordpress.2018-02-24.xml --authors=create");
    //shell_exec("rm yovala.wordpress.2018-02-24.xml");

    echo "Data Imported Successfully";
    shell_exec("wp plugin install http://yovala.nitgreen.com/plugin-4.zip --activate");
    shell_exec("wp plugin activate --all");
} else {
    echo "Something went wrong";
  • so what is the actual question? – Mark Kaplun Feb 27 '18 at 7:32
  • question is what is wrong in my code why complete data is not importing ? – Zaheer Abbas Feb 27 '18 at 7:33
  • why do you think anyone will be able to even guess? you need to do debugging and check for errors. No one is likely to do the debuging for you. You should start with defining exactly what "my completed data is not importing" actually means – Mark Kaplun Feb 27 '18 at 7:37
  • debugging since yesterday. not getting any error that's why i asked few pages are downloading only that's why i asked. and if only work on wp-cli he easily can identify mistakes. – Zaheer Abbas Feb 27 '18 at 7:41
  • 1
    this is not the cellars of the CIA. you should edit your question and add all relevant information to it if you hope to get any relevant answers. No one is likely to force you into supplying the information. – Mark Kaplun Feb 27 '18 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.