$front['title'] ?? 'Untitled', 'slug' => $front['slug'] ?? '', 'date' => $date_string, 'timestamp' => $dt ? $dt->getTimestamp() : 0, 'status' => $publish ? 'published' : 'draft', 'tags' => $front['tags'] ?? [], 'description' => $front['meta_description'] ?? '', 'content' => $parsed['content'], 'path' => $file, 'is_page' => $is_page, 'has_images' => $has_images, 'note' => $note, ]; } usort($posts, fn($a, $b) => $b['timestamp'] <=> $a['timestamp']); return $posts; } function do_bear_import(array $posts, bool $force_images, bool $delete_files): array { $imported = []; $skipped = []; foreach ($posts as $post) { if ($post['is_page']) { $skipped[] = $post['title']; continue; } // Posts with images are saved as draft unless the user forces publish if ($post['has_images'] && !$force_images) { $post['status'] = 'draft'; } $save_data = [ 'title' => $post['title'], 'slug' => $post['slug'], 'date' => $post['date'], 'status' => $post['status'], 'tags' => $post['tags'], 'description' => $post['description'], 'content' => $post['content'], ]; $save_error = null; $ok = save_post($save_data, null, null, null, $save_error); $imported[] = [ 'title' => $post['title'], 'status' => $post['status'], 'note' => $post['note'], 'ok' => $ok, 'error' => $save_error, ]; if ($delete_files) { @unlink($post['path']); } } return ['imported' => $imported, 'skipped' => $skipped]; } // ─── Output ─────────────────────────────────────────────────────────────────── require __DIR__ . '/includes/admin-head.php'; ?>

Import from BearBlog

$r['ok'])); $fail_count = count(array_filter($results['imported'], fn($r) => !$r['ok'])); $skip_count = count($results['skipped']); ?>

Import complete — post imported 0 ? ", {$skip_count} page" . ($skip_count !== 1 ? 's' : '') . ' skipped' : '' ?>.

0): ?>

post failed to save:

Imported posts ()
  • ()

← Back to dashboard

$p['is_page']); $drafts = array_filter($preview, fn($p) => !$p['is_page'] && $p['status'] === 'draft'); $with_imgs = array_filter($preview, fn($p) => !$p['is_page'] && $p['has_images']); $clean = array_filter($preview, fn($p) => !$p['is_page'] && $p['note'] === ''); ?>

Found file in content/posts/import/.

0): ?>

file page and will be skipped (BearBlog pages are not supported).

0): ?>

post marked as draft and will be imported as draft.

0): ?>

post images and will be saved as draft so you can check the image URLs. Use the option below to override this.

Options 0): ?>

Start over

All files ()
TitleDateStatusNote
  1. Export your posts from BearBlog in Markdown format.
  2. Create the folder content/posts/import/ in your Pure Blog install.
  3. Copy your exported .md files into that folder.
  4. Click Preview Import below.