White Screen or 404 and Blank Site after Cloning
Symptoms after Cloning:
- White Screen of Death
- 404 Page not Found
- New cloned site exists but is empty or blank
- Server Error 500
- Multisite network installations running in Subdomain mode
- Multisite network installations running in Subdirectory mode (also called Subfolder mode)
Cause and Solutions:
These symptoms almost always mean that the Cloner is unable to complete it’s cloning process due inadequate system resource configurations.
The Cloner was originally designed as a site template cloning tool to save multisite admins a lot of time when deploying new copies of empty sites as a starting point for new sites. In order to use it for copying large, established sites with lots of plugins, posts, files, etc. your server performance settings will have to be tweaked to make sure that the Cloning process can complete.
The primary PHP settings that you should pay close attention to, and our recommended starting points for their settings are:
- max_execution_time = 600 [this is in seconds]
- memory_limit = 512MB
We have a future version of the Cloner planned to run in a batching mode to handle extremely large sites. However, in the meantime, with the right settings, it should still be able to handle most cloning operations. Some other things that you can do to ensure it has the best chances of completing successfully:
- Make a DB backup before optimizing your database in case you need to go back or recover anything.
- Delete and purge all post revisions and auto saves – your DB might have many times the number of posts in actual size from the revisions.
- Delete and purge all transients
- Make sure that “Capture additional debug logging to Detailed Log” option is NOT checked
- Remove all unused plugins (and any tables they have created)
- Purge all temporary data from active plugins (things like redirection logs, old activity logs, etc.)
- Optimize the DB (There are several plugins that make this really simple)
- Keep increasing max_execution_time and memory_limit as required. We’ve had to bump memory_limit as high as 768MB before to get some intense multisite plugins to work correctly.
As a last resort, you can try using a 2-step or 3-step cloning process if you have the Pro Version:
- Try UNchecking the options to Copy ALL posts and Copy media files, and run the clone that way. This will clone the site structure without the wp_post* tables or media files. This should complete fairly quickly.
- Then, you could either run a standard WordPress XML export / import to get the content, OR you can use the Cloner in Clone-over mode and only use the Copy all posts option, supplying the new site ID generated in step 1 for the Target ID field.
- If necessary, Clone-over mode could be used again to copy only the media files – or the media files can be copied manually in the file system
When cloning large sites (anything above a couple hundred posts) with lots of plugins and files it is critical to make sure that all server resource limits are set adequately (memory and execution time) and that the DB itself has no unnecessary or extra data clutter.
Hopefully with every precaution taken you’ll be able to clone even your larger sites!