I am currently importing a Drupal blog into WordPress, and there are a lot of pages and blog posts to import. When I run the query it says it doesn’t have sufficient memory or crashes. I can run the query piece by piece using LIMIT, but I’m wondering if there is some smarter way to do the equivalent.
Either by running a for loop to insert a certain number of values at a time, or a callback function to execute the query after the query has been executed… I’m not sure. Is there already a “best practice” way to do this?
Yes, use the script bigdump http://www.ozerov.de/bigdump/. It does a staggered import of an sql file. I always use it for importing databases that are larger then my phpMyAdmin allows.