If you have access to phpMyAdmin you can run this SQL query directly:
UPDATE {prefix}posts SET post_status="draft" WHERE post_status="publish"
If you do not have any experience with SQL queries then you should use this solution. Just place this code in functions.php
and refresh the WordPress once, and it will be done.
function setPostsToDraft()
{
global $wpdb;
$qry = 'UPDATE '.$wpdb->prefix.'posts SET post_status="draft" WHERE post_status="publish"';
$wpdb->query($qry);
}
setPostsToDraft();