• Resolved avifb

    (@avifb)


    Hello,
    I moved to a new hosting company and tried to restore my blog. When I imported the SQL backup file for the database I got the white screen of death.
    For a week now I can’t restore the site using the common method.
    Anyway, the site had only 2 pages and 13 posts, so I figured I could restore it if I had the text.

    I would like to extract all posts and pages content from the database into a txt file.
    Can anybody help me with the SQL query to do that?
    (thank you)

Viewing 1 replies (of 1 total)
  • Thread Starter avifb

    (@avifb)

    SELECT wp_posts.post_title as Title, wp_posts.post_date as DATE,
    GROUP_CONCAT(wp_terms.name) AS TAGS, wp_posts.post_content as CONTENT FROM wp_terms
    INNER JOIN wp_term_taxonomy ON wp_terms.term_id = wp_term_taxonomy.term_id
    INNER JOIN wp_term_relationships ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
    INNER JOIN wp_posts ON wp_posts.ID = wp_term_relationships.object_id
    WHERE post_author = 1 AND post_type LIKE ‘post’ AND post_status LIKE ‘publish’ GROUP BY wp_posts.ID order by post_date

Viewing 1 replies (of 1 total)
  • The topic ‘SQL Query to extract all posts and pages to txt file’ is closed to new replies.