Blog

New Import from existing DB tables script (just global functions right now)

This script will eventually find it’s way into the PodAPI importing functions, but right now here’s what I’ve got so far. It does quite a bit out of the gate – enjoy!

It imports items from another MySQL table (does multiple at a time actually) into your Pods. So basically, a migration script for those who have their content elsewhere! It’s not limited to straight column-to-column migrations though, it lets you do pre-processing, filtering, post-processing, and many other things!

UPDATE: Now includes Paginated importing (a few at a time with the ‘limit’ option), and verbose information while importing on every step along with a new Estimation / Status box at the top of the page that updates automatically via Javascript with the current % completed, and a ‘time left’ projection (plus time spent so far).

http://pods.pastebin.com/SXqEW5mG

For large imports, this code may help you tweak your PHP settings to perform the migration using the resources available on your own server:

http://pods.pastebin.com/HWAX0nFL

Also, something I’ve found very useful is that I created a simple “UI” for this, in which I can just built out my $import array and choose which ones I want to run, keeping the old ones easily accessible if I need to rerun or reset them:

http://pods.pastebin.com/yYSxSZXs