Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you need to import content that's unpublished, but scheduled for future publication, you can do so by setting a node's 'publish_on' property in your Migration class's prepare() method implementation. For example:
// In construct(), you have a row that has a published status of 0:
public function __construct() {
$this->addFieldMapping('status', 'status');
}
// In prepare(), you can set the timestamp for the time the node should
// be published (requires scheduler.module).
public function prepare($node, stdClass $row) {
if ($node->status == 0 && $row->status == 0 && $row->publish_time >= time()) {
$node->publish_on = $row->publish_time;
}
}