-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrate-to-sqlcipher.html
More file actions
378 lines (337 loc) · 21 KB
/
Copy pathmigrate-to-sqlcipher.html
File metadata and controls
378 lines (337 loc) · 21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- Favicons -->
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<title>Migrate to SQLCipher — DB Browser (SQLCipher) for Windows</title>
<meta name="description" content="Step‑by‑step migration from plain SQLite to SQLCipher using the portable DB Browser build for Windows. Backups, parameters, import/verify, and common pitfalls.">
<link rel="canonical" href="https://db-browser.github.io/migrate-to-sqlcipher.html">
<!-- Open Graph -->
<meta property="og:title" content="Migrate to SQLCipher — DB Browser (SQLCipher) for Windows">
<meta property="og:description" content="Safe, consistent migration from plain SQLite to SQLCipher. Checklist, How‑To steps, and troubleshooting for Windows portable build.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://db-browser.github.io/migrate-to-sqlcipher.html">
<meta property="og:image" content="https://db-browser.github.io/og-image.png">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Migrate to SQLCipher — DB Browser (SQLCipher) for Windows">
<meta name="twitter:description" content="Step‑by‑step migration from plain SQLite to SQLCipher (Windows, portable). Verify, standardize, and avoid common errors.">
<meta name="twitter:image" content="https://db-browser.github.io/og-image.png">
<meta name="author" content="Community / Unofficial resource">
<meta name="last-modified" content="">
<!-- Google tag (GA4) + Consent Mode v2: load regardless of consent, default denied -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'wait_for_update': 500
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-N1MPKLJ6KC"></script>
<script>
gtag('js', new Date());
gtag('config', 'G-N1MPKLJ6KC', { 'anonymize_ip': true });
</script>
<!-- Inline critical CSS (same palette and layout as your sample) -->
<style>
:root{
--bg:#ffffff;
--text:#0b2545;
--muted:#6b7280;
--accent:#0b63a5;
--accent-2:#f7a21a;
--card:#f8fafc;
--radius:10px;
--maxwidth:1100px;
--focus: 3px solid rgba(11,99,165,0.15);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;font-size:16px;line-height:1.55;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--accent)}
header{background:linear-gradient(180deg,#ffffff 0%, #f7fbff 100%);border-bottom:1px solid #e6eef6}
.wrap{max-width:var(--maxwidth);margin:0 auto;padding:20px}
.site-header{display:flex;align-items:center;gap:18px;padding:10px 0}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}
.brand:hover{text-decoration:none}
nav{margin-left:auto}
.nav-list{display:flex;gap:8px;flex-wrap:wrap}
.nav-list a{padding:6px 10px;border-radius:8px;text-decoration:none;color:var(--text);font-weight:600;font-size:14px;line-height:1}
.nav-list a:focus{outline:var(--focus)}
main{padding:28px 20px}
.hero{display:grid;gap:18px;grid-template-columns:1fr;align-items:stretch}
.kicker{color:var(--muted);font-weight:600;font-size:13px}
.title{font-size:30px;margin:4px 0 6px;color:var(--text);line-height:1.2}
.lead{color:var(--muted);max-width:75ch}
.cta-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}
.btn{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:10px;border:0;background:var(--accent);color:white;font-weight:700;text-decoration:none;cursor:pointer}
.btn.secondary{background:#eef6fb;color:var(--accent);border:1px solid #dbeefc}
.btn:focus{outline:var(--focus)}
.card{background:var(--card);padding:16px;border-radius:var(--radius);box-shadow:0 1px 0 rgba(11,99,165,0.03)}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.feature{padding:14px}
.hero-callout{display:flex;flex-direction:column;gap:12px}
.check{display:flex;gap:10px;align-items:flex-start;color:var(--muted)}
.check svg{color:var(--accent)}
footer{padding:24px 20px;border-top:1px solid #e6eef6;margin-top:40px}
.footer-grid{display:flex;gap:24px;flex-wrap:wrap;align-items:center}
.muted{color:var(--muted);font-size:14px}
/* cookie banner */
.cookie-banner{position:fixed;left:16px;right:16px;bottom:16px;background:linear-gradient(180deg,#fffefe,#f7fbff);padding:12px;border-radius:12px;box-shadow:0 10px 30px rgba(11,99,165,0.08);display:flex;align-items:center;gap:12px;z-index:999}
.cookie-text{flex:1}
/* responsive */
@media (min-width:900px){
.hero{grid-template-columns:1.1fr 0.9fr}
}
@media (min-width:700px){
.grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:699px){
.nav-list{display:none}
.mobile-nav{display:flex;margin-left:auto}
.grid{grid-template-columns:1fr}
}
a:focus,button:focus{outline-offset:3px}
.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
</style>
<!-- Inline SVG symbols (same set as sample) -->
<svg style="display:none" aria-hidden="true">
<symbol id="icon-logo" viewBox="0 0 64 64">
<rect x="6" y="14" width="52" height="36" rx="4" fill="currentColor" />
<path d="M18 22h28M18 30h28M18 38h16" stroke="#fff" stroke-width="2" stroke-linecap="round" />
</symbol>
<symbol id="icon-download" viewBox="0 0 24 24"><path d="M12 3v10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 13l7 7 7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M21 21H3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
<symbol id="icon-lock" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="10" rx="2" stroke="currentColor" stroke-width="2" fill="none"/><path d="M7 11V8a5 5 0 0110 0v3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
<symbol id="icon-db" viewBox="0 0 24 24"><ellipse cx="12" cy="6" rx="9" ry="3" stroke="currentColor" stroke-width="2" fill="none"/><path d="M3 6v6c0 1.7 4 3 9 3s9-1.3 9-3V6" stroke="currentColor" stroke-width="2" fill="none"/></symbol>
<symbol id="icon-close" viewBox="0 0 24 24"><path d="M6 6l12 12M6 18L18 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
<symbol id="icon-check" viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
</svg>
<!-- JSON-LD: BreadcrumbList + HowTo (no direct file URLs) -->
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@graph":[
{
"@type":"BreadcrumbList",
"itemListElement":[
{"@type":"ListItem","position":1,"name":"Home","item":"https://db-browser.github.io/"},
{"@type":"ListItem","position":2,"name":"Migrate to SQLCipher","item":"https://db-browser.github.io/migrate-to-sqlcipher.html"}
]
},
{
"@type":"HowTo",
"name":"Migrate an existing SQLite database to SQLCipher",
"description":"Safe migration from plain SQLite to SQLCipher using the portable DB Browser build (Windows).",
"mainEntityOfPage":"https://db-browser.github.io/migrate-to-sqlcipher.html",
"step":[
{"@type":"HowToStep","name":"Back up your database","text":"Create a copy of the original file and (optionally) verify its SHA‑256 hash."},
{"@type":"HowToStep","name":"Create a new encrypted DB","text":"Use DB Browser to create a new encrypted database with your standard parameters and a strong passphrase."},
{"@type":"HowToStep","name":"Align SQLCipher parameters","text":"Confirm page size, KDF and HMAC settings match your standard. Adjust PRAGMAs if needed and reopen."},
{"@type":"HowToStep","name":"Import schema and data","text":"Import tables and data from the original DB; for large datasets prefer CSV import in chunks."},
{"@type":"HowToStep","name":"Verify and swap","text":"Reopen with the same key to verify; then replace the old file in production and keep backups safe."}
]
}
]
}
</script>
</head>
<body>
<header>
<div class="wrap site-header" role="banner">
<a class="brand" aria-label="site brand" href="/">
<svg width="44" height="44" viewBox="0 0 64 64" fill="var(--accent)"><use href="#icon-logo"></use></svg>
<div>
<div style="font-size:18px;margin:0;font-weight:700;color:var(--text)">DB Browser (SQLCipher) — Windows</div>
<div class="muted" style="font-size:13px">Portable download, guides, troubleshooting</div>
</div>
</a>
<nav aria-label="Main Navigation">
<div class="nav-list">
<a href="/download.html">Download</a>
<a href="/getting-started.html">Getting Started</a>
<a href="/encrypt-decrypt-sqlcipher.html">Encrypt / Decrypt</a>
<a href="/troubleshooting.html">Troubleshooting</a>
<a href="/migrate-to-sqlcipher.html">Migrate</a>
<a href="/best-practices-security.html">Security</a>
<a href="/alternatives.html">Alternatives</a>
<a href="/faq.html">FAQ</a>
<a href="/about.html">About</a>
</div>
</nav>
<div class="mobile-nav" style="display:none">
<button aria-label="open menu" class="btn secondary" onclick="document.querySelector('.nav-list').style.display='flex'">Menu</button>
</div>
</div>
</header>
<main class="wrap" id="main">
<!-- Hero -->
<section class="hero card" aria-labelledby="hero-title">
<!-- Left: main pitch -->
<div>
<div class="kicker">Official‑style build • Portable Windows EXE</div>
<h1 id="hero-title" class="title">Migrate SQLite databases to SQLCipher — Step‑by‑Step</h1>
<p class="lead">Follow a safe, consistent process to migrate from plain SQLite to SQLCipher using the portable Windows build of DB Browser. Standardize parameters, import data reliably, verify integrity, and avoid “wrong key” or performance regressions.</p>
<div class="cta-row">
<a class="btn" href="/download.html" title="Download Portable EXE">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" style="margin-right:6px"><use href="#icon-download"></use></svg> Download (Portable)
</a>
<a class="btn secondary" href="/sqlcipher.html">SQLCipher basics</a>
<a class="btn secondary" href="/open-encrypted-db.html">Open an Encrypted DB</a>
</div>
<p class="muted" style="margin-top:12px">All downloads are consolidated on the <a href="/download.html">Download page</a> and protected by a CAPTCHA gate. No direct file links are exposed on this site.</p>
</div>
<!-- Right: highlights -->
<aside class="card hero-callout" aria-label="Quick checklist">
<div style="display:flex;align-items:center;gap:12px">
<svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="var(--accent)"><use href="#icon-lock"></use></svg>
<div>
<strong>Quick checklist</strong>
<div class="muted" style="font-size:13px">Backups first, then standardize and verify.</div>
</div>
</div>
<div class="check"><svg width="18" height="18"><use href="#icon-check"></use></svg><span>Make a backup and (optionally) verify its hash</span></div>
<div class="check"><svg width="18" height="18"><use href="#icon-check"></use></svg><span>Decide on standard cipher parameters (page size, KDF, HMAC)</span></div>
<div class="check"><svg width="18" height="18"><use href="#icon-check"></use></svg><span>Create a new encrypted DB with those parameters</span></div>
<div class="check"><svg width="18" height="18"><use href="#icon-check"></use></svg><span>Import schema/data and reopen to verify integrity</span></div>
<div class="check"><svg width="18" height="18"><use href="#icon-check"></use></svg><span>Swap in production; keep backups and passphrases safe</span></div>
</aside>
</section>
<!-- Before you start -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Before you start</h2>
<ul class="muted" style="margin:6px 0 0 16px">
<li>Back up the original database (e.g., <code>data.bak.sqlite</code>) and keep it offline.</li>
<li>Optionally compute and store a checksum (SHA‑256) to verify backup integrity.</li>
<li>Standardize the SQLCipher parameters your team will use across databases.</li>
<li>Download and extract the portable build → <a href="/download.html">Download</a>. Run it once to clear SmartScreen/AV prompts.</li>
</ul>
</section>
<!-- Migration steps -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Migration steps</h2>
<ol class="muted" style="margin:6px 0 0 16px">
<li style="margin-bottom:8px"><strong>Create a new encrypted database</strong> — In DB Browser choose <em>File → New Database…</em>, set a strong passphrase, and confirm cipher parameters before saving.</li>
<li style="margin-bottom:8px"><strong>Align SQLCipher parameters</strong> — Reopen and confirm <em>page size</em>, <em>KDF</em> and <em>HMAC</em> settings match your standard. Adjust via <a href="/cli-commands.html">PRAGMA commands</a> if needed.</li>
<li style="margin-bottom:8px"><strong>Import schema and data</strong> — For small DBs, export SQL and execute on the new DB. For large datasets consider chunked <a href="/csv-import-export.html">CSV import</a>.</li>
<li style="margin-bottom:8px"><strong>Verify integrity</strong> — Close and reopen with the same key; browse tables, compare row counts, and run integrity checks.</li>
<li><strong>Swap in production</strong> — Replace the old file once verified. Retain backups and update apps to use the correct passphrase and parameters.</li>
</ol>
<p class="muted" style="margin-top:8px">If you encounter a “wrong key” error, see <a href="/wrong-key-errors.html">Wrong key errors</a> and revisit <a href="/sqlcipher.html">SQLCipher basics</a> — it usually indicates a parameter mismatch.</p>
</section>
<!-- Troubleshooting & pitfalls -->
<section style="margin-top:18px" class="card">
<h2 style="margin:0 0 6px 0">Troubleshooting & common pitfalls</h2>
<ul class="muted" style="margin:6px 0 0 16px">
<li><strong>“file is not a database”</strong> — Make sure you opened the main <code>.sqlite</code> file (not WAL/SHM).</li>
<li><strong>“wrong key”</strong> — Ensure page size, KDF and HMAC settings match the database; confirm passphrase; see <a href="/wrong-key-errors.html">Wrong key guide</a>.</li>
<li><strong>Performance regressions</strong> — Review <a href="/performance-tips.html">PRAGMAs</a>, run <em>VACUUM</em>/<em>ANALYZE</em> post‑import, and consider indices.</li>
<li><strong>SmartScreen/AV</strong> — Unblock in file properties or whitelist the portable EXE after first run.</li>
<li><strong>Backups & rotation</strong> — Keep encrypted backups safe; rotate passphrases periodically following <a href="/best-practices-security.html">security best practices</a>.</li>
</ul>
</section>
<!-- Next steps -->
<section style="margin-top:18px">
<div class="grid">
<div class="card feature">
<strong>Encrypt / Decrypt</strong>
<p class="muted">Create encrypted DBs, rotate passphrases, and decrypt safely during migrations.</p>
<a class="btn secondary" href="/encrypt-decrypt-sqlcipher.html" style="margin-top:8px">How to Encrypt</a>
</div>
<div class="card feature">
<strong>Open encrypted DB</strong>
<p class="muted">Pick the right parameters to open existing SQLCipher databases without errors.</p>
<a class="btn secondary" href="/open-encrypted-db.html" style="margin-top:8px">Open DB Guide</a>
</div>
<div class="card feature">
<strong>Get the portable build</strong>
<p class="muted">All downloads go through a CAPTCHA gate for safety — no direct links exposed.</p>
<a class="btn" href="/download.html" style="margin-top:8px">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" style="margin-right:6px"><use href="#icon-download"></use></svg>
Download (Portable)
</a>
</div>
</div>
</section>
<div style="margin-top:18px;display:flex;gap:12px;align-items:center;flex-wrap:wrap">
<div class="muted">Page last modified: <span id="lastModified" class="muted">--</span></div>
<div class="muted">|</div>
<div class="muted">Canonical: <a href="https://db-browser.github.io/migrate-to-sqlcipher.html">https://db-browser.github.io/migrate-to-sqlcipher.html</a></div>
</div>
</main>
<footer>
<div class="wrap footer-grid">
<div class="muted">© Community • Unofficial resource • <a href="https://github.com/sqlitebrowser/sqlitebrowser">Source</a></div>
<div style="margin-left:auto" class="muted">
<a href="/changelog.html">Changelog</a> •
<a href="/contact.html">Contact</a> •
<a href="#" onclick="openConsent()">Cookie settings</a> •
<a href="/privacy.html">Privacy</a> •
<a href="/terms.html">Terms</a>
</div>
</div>
</footer>
<!-- Cookie banner (accept / decline / close) -->
<div id="cookieBanner" class="cookie-banner" role="dialog" aria-live="polite" style="display:none">
<div style="display:flex;align-items:center;gap:12px">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="var(--accent)"><use href="#icon-db"></use></svg>
</div>
<div class="cookie-text">
<strong>We use analytics</strong>
<div class="muted">This site uses Google Analytics (GA4). You can accept or decline analytics cookies at any time in cookie settings.</div>
</div>
<div style="display:flex;gap:8px">
<button class="btn" id="acceptCookies">Accept</button>
<button class="btn secondary" id="declineCookies">Decline</button>
<button class="btn secondary" id="closeBanner" aria-label="Close cookie banner"><svg width="14" height="14" viewBox="0 0 24 24"><use href="#icon-close"></use></svg></button>
</div>
</div>
<noscript><div style="padding:12px;background:#fff3cd;color:#856404;text-align:center">JavaScript is required for cookie consent. You can still navigate the site.</div></noscript>
<!-- Inline JS: consent + small helpers (same logic as your sample) -->
<script>
/* Configuration */
const CONSENT_KEY = 'dbbrowser_consent_v2'; // values: accepted, declined, closed
function setConsent(val){ try{localStorage.setItem(CONSENT_KEY,val)}catch(e){} }
function getConsent(){ try{return localStorage.getItem(CONSENT_KEY)}catch(e){return null} }
function showBanner(){document.getElementById('cookieBanner').style.display='flex'}
function hideBanner(){document.getElementById('cookieBanner').style.display='none'}
document.getElementById('acceptCookies').addEventListener('click',function(){
setConsent('accepted');
try{ gtag('consent','update', { 'analytics_storage': 'granted' }); }catch(e){}
hideBanner();
});
document.getElementById('declineCookies').addEventListener('click',function(){
setConsent('declined');
try{ gtag('consent','update', { 'analytics_storage': 'denied', 'ad_storage':'denied', 'ad_user_data':'denied', 'ad_personalization':'denied' }); }catch(e){}
hideBanner();
});
document.getElementById('closeBanner').addEventListener('click',function(){
setConsent('closed');
hideBanner();
});
function openConsent(){ showBanner(); }
window.addEventListener('load',function(){
// lastModified
var lm = document.lastModified || new Date().toISOString();
document.querySelector('meta[name="last-modified"]').setAttribute('content', lm);
var el = document.getElementById('lastModified'); if(el) el.textContent = lm;
// Consent boot
const consent = getConsent();
if(!consent){ showBanner(); }
if(consent === 'accepted'){
try{ gtag('consent','update', { 'analytics_storage': 'granted' }); }catch(e){}
}
});
// ESC closes the banner
document.addEventListener('keydown', function(e){ if(e.key === 'Escape'){ hideBanner(); } });
</script>
</body>
</html>