Drupal Development Blog is brought to you by Face 2 Interface, home of open source applications for your website.

Changing Sites

Geez, did more of this manually than I thought. The old site is small right now, but I thought it might be easy to copy of the whole database on a fresh installation here.

Well it wasn't. I made a handful of changes to the exported data but it still gave me trouble. So I've just done it the hard way, which at least worked. With only 7 blog entries I copied and pasted them in by hand.

Since I'd installed the meta tags aka nodewords module after writing several of those blog entries decided it wasn't so bad. Re-entering everything also got me to go through them and add descriptions and keywords for the ones that didn't already have them, which is most of them.

Back End Datestamp Manipulation

Well one little problem I didn't want to live with was that by re-creating my old articles on the new site the datestamps were all new.

I don't know of a way to fix this easily on the front end. If anybody out there does know, please comment on this to share your solution.

The way I handled it was to work directly on the MySQL database. Turns out that content is contained in the node table. And two columns of particular interest here are title and created. Title identifies which blog entry I'm working with, and created has a Unix timestamp to preserve the time of creation, which almost sounds more important than it is. If you see what I mean.

Anyway, here's a query on my shell account after connecting to the MySQL server:

mysql> select title, created from node;

title created
Drupal @ Face2Interface.com 1180555244
My First Error 1184600162
Drupal Themes 1184601164
Creating a New Module 1184601526
Enabling Built-in Modules 1184602253
Hacking the Statistics Module 1184602392
The Meta Tags / Nodewords Module 1184602450

7 rows in set (0.00 sec)

Pretty straightforward from here. I got the same info for the old site's nodes and that gave me the Unix timestamps which I wanted to change over to, i.e. the original timestamps.

Using that info and some regular expressions on my workstation running Textpad, here are the MySQL update queries:

update node set created = 1180559112 where created = 1184600162;
update node set created = 1180634694 where created = 1184601164;
update node set created = 1181218143 where created = 1184601526;
update node set created = 1181310987 where created = 1184602253;
update node set created = 1181843944 where created = 1184602392;
update node set created = 1184170525 where created = 1184602450;

And voila! Now all my old blog entries have been ported over to the new site, and the creetion dates are accurate according to when they originally posted on the old site.