{"title":"Backup & Restore","slug":"backup-restore","category":"guides","summary":"Memories für Backup exportieren, zwischen Minds migrieren, nach Datenverlust wiederherstellen.","audience":["human","llm"],"tags":["guide","backup","restore","migration"],"difficulty":"beginner","updated":"2026-06-27","word_count":246,"read_minutes":1,"lang":"de","translated":true,"requested_lang":"de","content_markdown":"\n# Backup & Restore\n\nSynapse bietet vollständigen Export/Import für Memory-Backup, Migration und\nDisaster-Recovery. Dieser Guide behandelt die essenziellen Operationen.\n\n## Export\n\n### Vollständiger Mind-Export\n\nAlle Memories eines Minds als JSON exportieren:\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/mind-export > backup.json\n```\n\nAntwort-Format:\n\n```json\n{\n  \"mind_id\": \"m_xyz789\",\n  \"mind_name\": \"Work Mind\",\n  \"exported_at\": \"2026-06-27T...\",\n  \"memory_count\": 142,\n  \"memories\": [\n    {\n      \"id\": \"mem_001\",\n      \"category\": \"identity\",\n      \"key\": \"user_name\",\n      \"content\": \"Michael Schäfer\",\n      \"tags\": [\"person\", \"identity\"],\n      \"priority\": \"critical\",\n      \"source\": \"user\",\n      \"verified\": true,\n      \"created_at\": \"2026-06-15T...\",\n      \"updated_at\": \"2026-06-27T...\"\n    }\n  ]\n}\n```\n\n### Inkrementeller Export (Diff)\n\nNur Memories exportieren, die seit einem Zeitstempel geändert wurden:\n\n```bash\nSINCE=$(date -d \"2026-06-01\" +%s)\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/diff?since=$SINCE\" > incremental.json\n```\n\nAntwort:\n\n```json\n{\n  \"added\": [...],\n  \"updated\": [...],\n  \"deleted\": [...]\n}\n```\n\n### Automatisierte Backups\n\nTägliche Backups via Cron planen:\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/cron \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"schedule\": \"0 2 * * *\",\n    \"endpoint\": \"https://synapse.schaefer.zone/memory/mind-export\",\n    \"method\": \"GET\",\n    \"headers\": {\"Authorization\": \"Bearer YOUR_MIND_KEY\"}\n  }'\n```\n\n> [!NOTE]\n> Der Cron-Endpunkt empfängt die Antwort, speichert sie aber nicht. Für echte\n> Backups lasse den Cron auf deinen eigenen Backup-Server zeigen, der die\n> Antwort speichert.\n\n### Besser: externes Backup-Script\n\n```bash\n#!/bin/bash\n# backup-synapse.sh\nMIND_KEY=\"${SYNAPSE_MIND_KEY}\"\nDATE=$(date +%Y%m%d)\nBACKUP_DIR=\"/backups/synapse\"\n\nmkdir -p \"$BACKUP_DIR\"\n\ncurl -s -H \"Authorization: Bearer $MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/mind-export \\\n     > \"$BACKUP_DIR/synapse-$DATE.json\"\n\n# Keep last 30 days\nfind \"$BACKUP_DIR\" -name \"synapse-*.json\" -mtime +30 -delete\n\necho \"Backup saved: $BACKUP_DIR/synapse-$DATE.json\"\n```\n\nZur Crontab hinzufügen:\n\n```cron\n0 2 * * * /usr/local/bin/backup-synapse.sh\n```\n\n## Restore\n\n### In denselben Mind wiederherstellen\n\n```bash\n# Parse backup and re-POST each memory\njq -c '.memories[]' backup.json | while read mem; do\n  curl -X POST https://synapse.schaefer.zone/memory \\\n    -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n    -H \"Content-Type: application/json\" \\\n    -d \"$(echo \"$mem\" | jq '{category, key, content, tags, priority}')\"\ndone\n```\n\n### In neuen Mind wiederherstellen\n\n```bash\n# 1. Create new mind\nNEW_KEY=$(curl -s -X POST https://synapse.schaefer.zone/minds \\\n  -H \"Authorization: Bearer YOUR_JWT\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Restored Mind\",\"description\":\"Restore from backup\"}' \\\n  | jq -r .mind_key)\n\n# 2. Import memories to new mind\njq -c '.memories[]' backup.json | while read mem; do\n  curl -X POST https://synapse.schaefer.zone/memory \\\n    -H \"Authorization: Bearer $NEW_KEY\" \\\n    -H \"Content-Type: application/json\" \\\n    -d \"$(echo \"$mem\" | jq '{category, key, content, tags, priority}')\"\ndone\n```\n\n### Python-Restore-Script\n\n```python\nimport json\nimport requests\n\nURL = \"https://synapse.schaefer.zone\"\nMIND_KEY = \"mk_...\"\n\ndef restore(backup_file):\n    with open(backup_file) as f:\n        data = json.load(f)\n    \n    for mem in data[\"memories\"]:\n        requests.post(\n            f\"{URL}/memory\",\n            headers={\n                \"Authorization\": f\"Bearer {MIND_KEY}\",\n                \"Content-Type\": \"application/json\"\n            },\n            json={\n                \"category\": mem[\"category\"],\n                \"key\": mem[\"key\"],\n                \"content\": mem[\"content\"],\n                \"tags\": mem.get(\"tags\", []),\n                \"priority\": mem.get(\"priority\", \"normal\")\n            }\n        )\n    \n    print(f\"Restored {len(data['memories'])} memories\")\n\nrestore(\"backup.json\")\n```\n\n## Migration zwischen Minds\n\n```python\ndef migrate_memories(source_key, target_key):\n    \"\"\"Migrate all memories from source mind to target mind.\"\"\"\n    # Export from source\n    r = requests.get(\n        f\"{URL}/memory/mind-export\",\n        headers={\"Authorization\": f\"Bearer {source_key}\"}\n    )\n    data = r.json()\n    \n    # Import to target\n    for mem in data[\"memories\"]:\n        requests.post(\n            f\"{URL}/memory\",\n            headers={\n                \"Authorization\": f\"Bearer {target_key}\",\n                \"Content-Type\": \"application/json\"\n            },\n            json={\n                \"category\": mem[\"category\"],\n                \"key\": mem[\"key\"],\n                \"content\": mem[\"content\"],\n                \"tags\": mem.get(\"tags\", []),\n                \"priority\": mem.get(\"priority\", \"normal\")\n            }\n        )\n    \n    print(f\"Migrated {len(data['memories'])} memories\")\n```\n\n## Andere Daten sichern\n\nNicht vergessen zu sichern:\n\n| Datentyp | Endpunkt |\n|-----------|----------|\n| Memories | `GET /memory/mind-export` |\n| Tasks | `GET /mind/tasks` |\n| Scripts | `GET /scripts` |\n| Webhooks | `GET /webhooks` |\n| Cron-Jobs | `GET /cron` |\n| Variables | `GET /var` |\n| Chat-Verlauf | `GET /chat/history?limit=10000` |\n\n## Verifikation\n\nNach dem Restore verifizieren:\n\n```bash\n# Count memories\ncurl -s -H \"Authorization: Bearer $KEY\" \\\n     https://synapse.schaefer.zone/memory/stats | jq .total\n\n# Compare with backup\njq .memory_count backup.json\n```\n\n## Best Practices\n\n> [!TIP]\n> - **Täglich sichern** — mit Cron automatisieren\n> - **Restores testen** — ein Backup, das du nicht restoren kannst, ist nutzlos\n> - **Mehrere Versionen aufbewahren** — mindestens 30 Tage\n> - **Offsite speichern** — S3, Backblaze B2 etc.\n> - **Sensible Backups verschlüsseln** — Memories können PII enthalten\n> - **Restore-Prozess dokumentieren** — bis du ihn brauchst, hast du ihn vergessen\n\n## Nächste Schritte\n\n- [Memory-API](/docs/api/memory)\n- [Cron & Scheduler](/docs/api/cron) — für automatisierte Backups\n","content_html":"<h1>Backup &amp; Restore</h1>\n<p>Synapse bietet vollständigen Export/Import für Memory-Backup, Migration und\nDisaster-Recovery. Dieser Guide behandelt die essenziellen Operationen.</p>\n<h2>Export</h2>\n<h3>Vollständiger Mind-Export</h3>\n<p>Alle Memories eines Minds als JSON exportieren:</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/mind-export &gt; backup.json</code></pre><p>Antwort-Format:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;mind_id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;m_xyz789&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;mind_name&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Work Mind&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;exported_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;memory_count&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">142</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;memories&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>\n    <span class=\"hljs-punctuation\">{</span>\n      <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;mem_001&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;category&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;identity&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;key&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;user_name&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;content&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Michael Schäfer&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;tags&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span><span class=\"hljs-string\">&quot;person&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;identity&quot;</span><span class=\"hljs-punctuation\">]</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;priority&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;critical&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;source&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;user&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;verified&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">true</span></span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-15T...&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;updated_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span>\n    <span class=\"hljs-punctuation\">}</span>\n  <span class=\"hljs-punctuation\">]</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>Inkrementeller Export (Diff)</h3>\n<p>Nur Memories exportieren, die seit einem Zeitstempel geändert wurden:</p>\n<pre><code class=\"hljs language-bash\">SINCE=$(<span class=\"hljs-built_in\">date</span> -d <span class=\"hljs-string\">&quot;2026-06-01&quot;</span> +%s)\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/diff?since=<span class=\"hljs-variable\">$SINCE</span>&quot;</span> &gt; incremental.json</code></pre><p>Antwort:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;added&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>...<span class=\"hljs-punctuation\">]</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;updated&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>...<span class=\"hljs-punctuation\">]</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;deleted&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>...<span class=\"hljs-punctuation\">]</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>Automatisierte Backups</h3>\n<p>Tägliche Backups via Cron planen:</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/cron \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;schedule&quot;: &quot;0 2 * * *&quot;,\n    &quot;endpoint&quot;: &quot;https://synapse.schaefer.zone/memory/mind-export&quot;,\n    &quot;method&quot;: &quot;GET&quot;,\n    &quot;headers&quot;: {&quot;Authorization&quot;: &quot;Bearer YOUR_MIND_KEY&quot;}\n  }&#x27;</span></code></pre><div class=\"callout callout-note\">Der Cron-Endpunkt empfängt die Antwort, speichert sie aber nicht. Für echte\nBackups lasse den Cron auf deinen eigenen Backup-Server zeigen, der die\nAntwort speichert.</div><h3>Besser: externes Backup-Script</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-meta\">#!/bin/bash</span>\n<span class=\"hljs-comment\"># backup-synapse.sh</span>\nMIND_KEY=<span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">${SYNAPSE_MIND_KEY}</span>&quot;</span>\nDATE=$(<span class=\"hljs-built_in\">date</span> +%Y%m%d)\nBACKUP_DIR=<span class=\"hljs-string\">&quot;/backups/synapse&quot;</span>\n\n<span class=\"hljs-built_in\">mkdir</span> -p <span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">$BACKUP_DIR</span>&quot;</span>\n\ncurl -s -H <span class=\"hljs-string\">&quot;Authorization: Bearer <span class=\"hljs-variable\">$MIND_KEY</span>&quot;</span> \\\n     https://synapse.schaefer.zone/memory/mind-export \\\n     &gt; <span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">$BACKUP_DIR</span>/synapse-<span class=\"hljs-variable\">$DATE</span>.json&quot;</span>\n\n<span class=\"hljs-comment\"># Keep last 30 days</span>\nfind <span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">$BACKUP_DIR</span>&quot;</span> -name <span class=\"hljs-string\">&quot;synapse-*.json&quot;</span> -mtime +30 -delete\n\n<span class=\"hljs-built_in\">echo</span> <span class=\"hljs-string\">&quot;Backup saved: <span class=\"hljs-variable\">$BACKUP_DIR</span>/synapse-<span class=\"hljs-variable\">$DATE</span>.json&quot;</span></code></pre><p>Zur Crontab hinzufügen:</p>\n<pre><code class=\"hljs language-plaintext\">0 2 * * * /usr/local/bin/backup-synapse.sh</code></pre><h2>Restore</h2>\n<h3>In denselben Mind wiederherstellen</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Parse backup and re-POST each memory</span>\njq -c <span class=\"hljs-string\">&#x27;.memories[]&#x27;</span> backup.json | <span class=\"hljs-keyword\">while</span> <span class=\"hljs-built_in\">read</span> mem; <span class=\"hljs-keyword\">do</span>\n  curl -X POST https://synapse.schaefer.zone/memory \\\n    -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n    -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n    -d <span class=\"hljs-string\">&quot;<span class=\"hljs-subst\">$(echo <span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">$mem</span>&quot;</span> | jq &#x27;{category, key, content, tags, priority}&#x27;)</span>&quot;</span>\n<span class=\"hljs-keyword\">done</span></code></pre><h3>In neuen Mind wiederherstellen</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># 1. Create new mind</span>\nNEW_KEY=$(curl -s -X POST https://synapse.schaefer.zone/minds \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;name&quot;:&quot;Restored Mind&quot;,&quot;description&quot;:&quot;Restore from backup&quot;}&#x27;</span> \\\n  | jq -r .mind_key)\n\n<span class=\"hljs-comment\"># 2. Import memories to new mind</span>\njq -c <span class=\"hljs-string\">&#x27;.memories[]&#x27;</span> backup.json | <span class=\"hljs-keyword\">while</span> <span class=\"hljs-built_in\">read</span> mem; <span class=\"hljs-keyword\">do</span>\n  curl -X POST https://synapse.schaefer.zone/memory \\\n    -H <span class=\"hljs-string\">&quot;Authorization: Bearer <span class=\"hljs-variable\">$NEW_KEY</span>&quot;</span> \\\n    -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n    -d <span class=\"hljs-string\">&quot;<span class=\"hljs-subst\">$(echo <span class=\"hljs-string\">&quot;<span class=\"hljs-variable\">$mem</span>&quot;</span> | jq &#x27;{category, key, content, tags, priority}&#x27;)</span>&quot;</span>\n<span class=\"hljs-keyword\">done</span></code></pre><h3>Python-Restore-Script</h3>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import</span> json\n<span class=\"hljs-keyword\">import</span> requests\n\nURL = <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone&quot;</span>\nMIND_KEY = <span class=\"hljs-string\">&quot;mk_...&quot;</span>\n\n<span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">restore</span>(<span class=\"hljs-params\">backup_file</span>):\n    <span class=\"hljs-keyword\">with</span> <span class=\"hljs-built_in\">open</span>(backup_file) <span class=\"hljs-keyword\">as</span> f:\n        data = json.load(f)\n    \n    <span class=\"hljs-keyword\">for</span> mem <span class=\"hljs-keyword\">in</span> data[<span class=\"hljs-string\">&quot;memories&quot;</span>]:\n        requests.post(\n            <span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory&quot;</span>,\n            headers={\n                <span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{MIND_KEY}</span>&quot;</span>,\n                <span class=\"hljs-string\">&quot;Content-Type&quot;</span>: <span class=\"hljs-string\">&quot;application/json&quot;</span>\n            },\n            json={\n                <span class=\"hljs-string\">&quot;category&quot;</span>: mem[<span class=\"hljs-string\">&quot;category&quot;</span>],\n                <span class=\"hljs-string\">&quot;key&quot;</span>: mem[<span class=\"hljs-string\">&quot;key&quot;</span>],\n                <span class=\"hljs-string\">&quot;content&quot;</span>: mem[<span class=\"hljs-string\">&quot;content&quot;</span>],\n                <span class=\"hljs-string\">&quot;tags&quot;</span>: mem.get(<span class=\"hljs-string\">&quot;tags&quot;</span>, []),\n                <span class=\"hljs-string\">&quot;priority&quot;</span>: mem.get(<span class=\"hljs-string\">&quot;priority&quot;</span>, <span class=\"hljs-string\">&quot;normal&quot;</span>)\n            }\n        )\n    \n    <span class=\"hljs-built_in\">print</span>(<span class=\"hljs-string\">f&quot;Restored <span class=\"hljs-subst\">{<span class=\"hljs-built_in\">len</span>(data[<span class=\"hljs-string\">&#x27;memories&#x27;</span>])}</span> memories&quot;</span>)\n\nrestore(<span class=\"hljs-string\">&quot;backup.json&quot;</span>)</code></pre><h2>Migration zwischen Minds</h2>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-keyword\">def</span> <span class=\"hljs-title function_\">migrate_memories</span>(<span class=\"hljs-params\">source_key, target_key</span>):\n    <span class=\"hljs-string\">&quot;&quot;&quot;Migrate all memories from source mind to target mind.&quot;&quot;&quot;</span>\n    <span class=\"hljs-comment\"># Export from source</span>\n    r = requests.get(\n        <span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory/mind-export&quot;</span>,\n        headers={<span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{source_key}</span>&quot;</span>}\n    )\n    data = r.json()\n    \n    <span class=\"hljs-comment\"># Import to target</span>\n    <span class=\"hljs-keyword\">for</span> mem <span class=\"hljs-keyword\">in</span> data[<span class=\"hljs-string\">&quot;memories&quot;</span>]:\n        requests.post(\n            <span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory&quot;</span>,\n            headers={\n                <span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{target_key}</span>&quot;</span>,\n                <span class=\"hljs-string\">&quot;Content-Type&quot;</span>: <span class=\"hljs-string\">&quot;application/json&quot;</span>\n            },\n            json={\n                <span class=\"hljs-string\">&quot;category&quot;</span>: mem[<span class=\"hljs-string\">&quot;category&quot;</span>],\n                <span class=\"hljs-string\">&quot;key&quot;</span>: mem[<span class=\"hljs-string\">&quot;key&quot;</span>],\n                <span class=\"hljs-string\">&quot;content&quot;</span>: mem[<span class=\"hljs-string\">&quot;content&quot;</span>],\n                <span class=\"hljs-string\">&quot;tags&quot;</span>: mem.get(<span class=\"hljs-string\">&quot;tags&quot;</span>, []),\n                <span class=\"hljs-string\">&quot;priority&quot;</span>: mem.get(<span class=\"hljs-string\">&quot;priority&quot;</span>, <span class=\"hljs-string\">&quot;normal&quot;</span>)\n            }\n        )\n    \n    <span class=\"hljs-built_in\">print</span>(<span class=\"hljs-string\">f&quot;Migrated <span class=\"hljs-subst\">{<span class=\"hljs-built_in\">len</span>(data[<span class=\"hljs-string\">&#x27;memories&#x27;</span>])}</span> memories&quot;</span>)</code></pre><h2>Andere Daten sichern</h2>\n<p>Nicht vergessen zu sichern:</p>\n<table>\n<thead>\n<tr>\n<th>Datentyp</th>\n<th>Endpunkt</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Memories</td>\n<td><code>GET /memory/mind-export</code></td>\n</tr>\n<tr>\n<td>Tasks</td>\n<td><code>GET /mind/tasks</code></td>\n</tr>\n<tr>\n<td>Scripts</td>\n<td><code>GET /scripts</code></td>\n</tr>\n<tr>\n<td>Webhooks</td>\n<td><code>GET /webhooks</code></td>\n</tr>\n<tr>\n<td>Cron-Jobs</td>\n<td><code>GET /cron</code></td>\n</tr>\n<tr>\n<td>Variables</td>\n<td><code>GET /var</code></td>\n</tr>\n<tr>\n<td>Chat-Verlauf</td>\n<td><code>GET /chat/history?limit=10000</code></td>\n</tr>\n</tbody></table>\n<h2>Verifikation</h2>\n<p>Nach dem Restore verifizieren:</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Count memories</span>\ncurl -s -H <span class=\"hljs-string\">&quot;Authorization: Bearer <span class=\"hljs-variable\">$KEY</span>&quot;</span> \\\n     https://synapse.schaefer.zone/memory/stats | jq .total\n\n<span class=\"hljs-comment\"># Compare with backup</span>\njq .memory_count backup.json</code></pre><h2>Best Practices</h2>\n<div class=\"callout callout-ok\"></div><h2>Nächste Schritte</h2>\n<ul>\n<li><a href=\"/docs/api/memory\">Memory-API</a></li>\n<li><a href=\"/docs/api/cron\">Cron &amp; Scheduler</a> — für automatisierte Backups</li>\n</ul>\n","urls":{"html":"/docs/guides/backup-restore","text":"/docs/guides/backup-restore?format=text","json":"/docs/guides/backup-restore?format=json","llm":"/docs/guides/backup-restore?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}