[development] Staging content to production servers

Bèr Kessels ber at webschuur.com
Mon Jun 19 17:01:27 UTC 2006


Op maandag 19 juni 2006 15:24, schreef Dave Cohen:
> I've found it convenient to hardcode IDs in various places of my own code.
>  So I've grown fond of the notion that some important IDs will remain the
> same from staging to testing to production.
>
> I'm not saying it can't be done without hardcoding the IDs.  But it's quite
> a challenge.

You are right: in my import export stuff, I allow hardcoded IDs:
 $node->id = 1234 
 $node->title = 'foo'
 $node->uid = <token>first_user_uid</token>

will be made into a post with nid 1234, title 'foo' and userID generated from 
the parser system in sympal scripts (ie replaced with a variable).

If you omit  $node->id it will be generated by Drupal. 
If you provide it, the system will try to do its best to either replace/alter 
the existing node, or to make a new one with that nid.

Bèr


More information about the development mailing list