Not all content is not copied from source site to destination in Cloner

When attempting to clone a source subsite (calgarybusiness) to destination subsite (amaster), the posts (directory listings) does not copy the content over.

    Mahlamusa

    Hello mindset,

    I hope you are doing great today. Thank you for reporting this issue to us and thank you for your patience as we were looking into this issue.

    I have tried to replicate this issue on my test website and as well as yours. I have noticed that Cloner works well with a small number of posts but once I had over 3000 posts I started experiencing the same issue on my test website. The process times out if its a large number of posts and then once it times out Cloner will move to the next post type. It may seem that the posts were copied but actually they were not copied at all.

    I checked the code and found it is not easier to modify it to accommodate the large number of posts in one run as this is a very tedious process and you will literally have to wait for it to process all those posts before you can access the website.

    As a workaround to this issue, I have created a custom plugin that will hook a Cron Job to copy the posts in the background while Cloner processes the other posts types. So basically, this custom plugin will queue a Cron Job immediately after copying setting and verify after copying menus to ensure the Cron Job is queued.

    Basically, this custom plugin will schedule a Cron Job task to run every minute to copy the posts in batches of 50 from the source to the destination blog until all posts are copied over and the two have identical posts.

    Please find the attached .zip file, you may install this as a plugin or upload the contained php file to the folder 'wp-content/mu-plugins', make sure that the php file is in the root of the mu-plugins as follows:

    wp-content/mu-plugins/copy-all-posts-cron.php

    Once the plugin is in place, you can run Cloner again to clone a website, this custom plugin will kick in once the settings and start copying posts once the settings and or menus are copied.

    I hope this helps. I know the most obvious solution would be to modify Cloner directly, but that will change a lot in the plugin itself so this solution is a better option to get you going. Please try the code and let us know how it goes, I only tested it on my test website and it seemed to do well as I was able to copy 4800 posts which was always failing before.

    Have a nice day.
    Mahlamusa