Datenbank von Drupal

  • Dupal-Datenbank
  • Nodes in Drupal
  • Anzahl der Nodes in einer Drupalinstallation
  • Nodes selektieren in Drupal
  • http://blondish.net/how-to-convert-drupal-to-wordpress/ How To Convert Drupal To WordPress
    INSERT INTO wordpress.wp_posts
    (id, post_author, post_date, post_content, post_title, post_excerpt,
    post_name, post_modified, post_type, post_status)
    SELECT DISTINCT
    n.nid id,
    n.uid post_author,
    FROM_UNIXTIME(n.created) post_date,
    rb.body_value post_content,
    n.title post_title,
    rb.body_summary post_excerpt,
    IF(SUBSTR(a.alias, 11, 1) = ‘/’, SUBSTR(a.alias, 12), a.alias) post_name,
    FROM_UNIXTIME(n.changed) post_modified,
    IF(n.type = “article”,”post”,n.type) as post_type,
    IF(n.status = 1, ‘publish’, ‘private’) post_status
    FROM drupal.node n
    INNER JOIN drupal.node_revision r
    USING(vid)
    INNER JOIN drupal.field_revision_body rb ON rb.entity_id = r.nid
    LEFT OUTER JOIN drupal.url_alias a
    ON a.source = CONCAT(‘node/’, n.nid)
    # Add more Drupal content types below if applicable.
    WHERE n.type IN (‘article’, ‘page’)
    ;

    INSERT INTO 5ma_posts
    (id, post_author, post_date, post_content, post_title, post_excerpt,
    post_name, post_modified, post_type, post_status)
    SELECT DISTINCT
    n.nid id,
    n.uid post_author,
    FROM_UNIXTIME(n.created) post_date,
    n.body post_content,
    n.title post_title,
    n.teaser post_excerpt,
    IF(SUBSTR(a.dst, 11, 1) = ‘/’, SUBSTR(a.dst, 12), a.dst) post_name,
    FROM_UNIXTIME(n.changed) post_modified,
    n.type post_type,
    IF(n.status = 1, ‘publish’, ‘private’) post_status
    FROM node n
    INNER JOIN node_revision r
    USING(vid)
    LEFT OUTER JOIN url_alias a
    ON a.src = CONCAT(‘node/’, n.nid)
    # Add more Drupal content types below if applicable.
    WHERE n.type IN (‘post’, ‘page’, ‘blog’)
    ;
  • select nd.nid as old_nid, title, created, field_today_value
    from node nd JOIN content_type_today td ON nd.nid = td.nid WHERE status = 1
    ORDER BY created ASC;
  • 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;

Siehe auch

Tabellen von Drupal
SQL-Befehle

KEYWORDS: Tabelle, Tabellen, node, nodes

Klassifikation

MySQL