Works by gathering information before removing the existing information from the MySQL tables. The gathering process takes ~17 sec. and the inserting takes only ~0.6 sec.
This script decreases the downtime with about 2700%
Modified from the example in php|architect’s Guide to Date and Time Programming by Derick Rethans.