Files
deardiary/www/docs/export-import.html

125 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Export & Import - DearDiary</title>
<link rel="stylesheet" href="../css/styles.css">
<link rel="stylesheet" href="../css/docs.css">
</head>
<body>
<nav class="navbar">
<div class="nav-container">
<a href="../" class="logo">
<svg width="32" height="32" viewBox="0 0 100 100"><defs><linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#6d28d9"/><stop offset="100%" style="stop-color:#4c1d95"/></linearGradient></defs><rect width="100" height="100" rx="20" fill="url(#g)"/><path d="M25 25 L75 25 L75 80 L25 80 Z" fill="none" stroke="white" stroke-width="3"/><path d="M35 40 L65 40 M35 50 L65 50 M35 60 L55 60" stroke="white" stroke-width="2"/></svg>
DearDiary
</a>
<div class="nav-links">
<a href="../">Home</a>
<a href="../docs/" class="active">Docs</a>
<a href="../blog/">Blog</a>
<a href="${GIT_URL}" target="_blank">Git Repository</a>
</div>
</div>
</nav>
<div class="docs-layout">
<aside class="docs-sidebar">
<div class="sidebar-section">
<h3>Getting Started</h3>
<a href="installation.html">Installation</a>
<a href="quick-start.html">Quick Start</a>
</div>
<div class="sidebar-section">
<h3>Configuration</h3>
<a href="configuration.html">Environment</a>
<a href="api.html">API Reference</a>
</div>
<div class="sidebar-section">
<h3>Features</h3>
<a href="ai-providers.html">AI Providers</a>
<a href="events.html">Events</a>
<a href="export-import.html" class="active">Export & Import</a>
</div>
</aside>
<main class="docs-content">
<h1>Export & Import</h1>
<p>Your data belongs to you. Export everything anytime, import to restore or migrate.</p>
<h2>Export</h2>
<p>Go to <strong>Settings</strong> and click <strong>Export Data</strong>. This downloads a JSON file containing:</p>
<ul>
<li><strong>version</strong> - DearDiary version</li>
<li><strong>exportedAt</strong> - Timestamp</li>
<li><strong>settings</strong> - Your AI and app settings</li>
<li><strong>events</strong> - All event records with metadata</li>
<li><strong>journals</strong> - All diary pages</li>
<li><strong>tasks</strong> - Generation history</li>
</ul>
<h2>Import</h2>
<p>Go to <strong>Settings</strong> and click <strong>Import Data</strong>. Select your export file.</p>
<h3>Import Behavior</h3>
<ul>
<li><strong>Duplicates skipped</strong> - Events matched by date + content + timestamp</li>
<li><strong>Journals matched by date</strong> - Won't create duplicate diaries</li>
<li><strong>Tasks linked to journals</strong> - Generation history preserved</li>
<li><strong>Settings overwritten</strong> - Your current settings are replaced</li>
</ul>
<h3>Version Compatibility</h3>
<p>DearDiary checks export versions:</p>
<ul>
<li>Minimum supported: 0.0.3</li>
<li>Warnings shown for older/newer versions</li>
<li>May lose data with very old exports</li>
</ul>
<div class="tip">
<strong>Tip:</strong> Export regularly as a backup. Store exports in a safe place.
</div>
<h2>Why Export?</h2>
<ul>
<li><strong>Backup</strong> - Protect against data loss</li>
<li><strong>Migration</strong> - Move to a new server</li>
<li><strong>Privacy</strong> - Keep a local copy</li>
<li><strong>Analysis</strong> - Work with your data in other tools</li>
</ul>
<h2>Export Format</h2>
<pre><code>{
"version": "0.1.0",
"exportedAt": "2026-03-27T12:00:00Z",
"settings": {
"aiProvider": "groq",
"aiApiKey": "gsk_xxx",
...
},
"events": [
{
"id": "evt_xxx",
"date": "2026-03-27",
"type": "text",
"content": "Had coffee with Sarah",
"latitude": 40.7128,
"longitude": -74.0060,
"placeName": "New York, NY",
"createdAt": "2026-03-27T08:30:00Z"
}
],
"journals": [...],
"tasks": [...]
}</code></pre>
<div class="next-steps">
<a href="events.html" class="btn">← Events</a>
<a href="ai-providers.html" class="btn btn-primary">Next: AI Providers →</a>
</div>
</main>
</div>
</body>
</html>