iandouglas.com | senior web architect

TAG | productivity

Mar/10

26

Data migration

After importing my Drupal database into my WordPress database, a single MySQL query imported all of my articles from Drupal to WordPress (without comments). All that’s left is to add categories and tags, and build URL redirects from thedouglasclan.com over to iandouglas.com. I simply got tired of some of the imitations I found in Drupal, and find WordPress a much friendlier interface to use.

For anyone curious enough, here’s the query I used to migrate from Drupal 6.8 to WordPress 2.9:

INSERT INTO wp_posts (id, post_author, post_date, post_content, post_title, post_excerpt, post_name, post_modified, post_status)
SELECT DISTINCT 120+n.nid, 1, FROM_UNIXTIME(created), body, n.title, teaser, REPLACE(REPLACE(REPLACE(REPLACE(LOWER(n.title),' ', '-'),'.', '-'),',', '-'),'+', '-'),FROM_UNIXTIME(changed), "draft"
FROM drupal6_node n, drupal6_node_revisions r
WHERE n.vid = r.vid;

The 120+ vaue in the ID field is because I currently had 120 items in my wp_posts table already, and each post must have a unique ID. So, I simply added a value of 120 to whatever ID value was in Drupal. The ’1′ value in the post_author field assigns my WordPress user ID as the author of each article. I also added a post_status of “draft” so I could go through the articles, verify their integrity, and then publish them.

, ,

Even while I had my iPhone as my primary mobile device, I had been interested in a car dock of some kind that didn’t involve a suction cup to my windshield or dashboard that could power the device and play audio into my car speakers. A coworker at Armor Games has a neat device, and forwarded a link to it at mwave.com: The Pixxo PF-C001 All-in-One Hands-Free Car Kit and Charger for iPhone or iPod w/ FM transmitter. It’s $15-$25 at mwave.com, $27 on eBay at the moment, and there are several similar items on Amazon for $15+. I went to Fry’s Electronics looking for something similar and only found iPhone-related gear. While the Pixxo device has an additional USB port on the side of the FM Transmitter, it would be inconvenient to have to use that to charge the primary device that’s being docked once my Nexus One arrived. What to do?

First off, my apologies for lack of photos. I thought about documenting it while I worked, but it was late last night. However, I do need to replace some of my handiwork with proper stuff like heat shrink and insulated wires to cut down on some radio interference.

First, I cut the iPod/iPhone adapter from the Pixxo unit, and saw that there were 8 wires (red, black, white, green, yellow, brown, purple and orange). Next, I cut a micro USB cable and saw that while it was well shielded on the outside, inside the foil insulator were only four wires (red, black, white and green). I twisted the matching wires together, taped it up enough that nothing was shorted, and tested it in the car, and my Nexus One started charging. w00t

Only thing left was to trim the wires back as far as I felt comfortable, shorten up the micro USB plug, and get everything taped up better. Which worked like a champ, except that I had no electrical tape, and I’m sure that as good as blue 3M Painter tape is, actual electrical tape or heat shrink would do a much better job.

Then, I shortened and spliced a stereo 3.5mm audio cable, as the one that shipped with the Pixxo unit was about two inches two short.

The net result:

(hosted at picasa)

, ,

quick and simple: edit /etc/hosts
(or on Windows machines: C:\WINDOWS\system32\drivers\etc\hosts)
and add the following:

0.0.0.0 www.facebook.com facebook.com apps.facebook.com
0.0.0.0 www.myspace.com myspace.com
0.0.0.0 www.digg.com digg.com

etc. Add as many sites as you want. When you want to stop being productive at work, simply comment out those lines (like during a lunch break). Just be sure to uncomment the lines when you need to be productive again…

,

Older posts >>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

 

July 2010
S M T W T F S
« Jun    
 123
45678910
11121314151617
18192021222324
25262728293031

Archives

Theme Design by devolux.org