[{"data":1,"prerenderedAt":1276},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fbancwr\u002Fbackup-and-restore":148,"\u002Fdocs\u002Fbancwr\u002Fbackup-and-restore-surround":1273},[4,19,62,93],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,11,15],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-rocket",{"title":12,"path":13,"stem":14},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F2.installation",{"title":16,"path":17,"stem":18},"Using Diogel","\u002Fdocs\u002Fgetting-started\u002Fusage","1.docs\u002F1.getting-started\u002F3.usage",{"title":20,"path":21,"stem":22,"children":23,"icon":61},"Porwr","\u002Fdocs\u002Fporwr","1.docs\u002F2.porwr\u002F01.index",[24,26,29,33,37,41,45,49,53,57],{"title":25,"path":21,"stem":22,"icon":10},"What is Porwr",{"title":12,"path":27,"stem":28},"\u002Fdocs\u002Fporwr\u002Finstallation","1.docs\u002F2.porwr\u002F02.installation",{"title":30,"path":31,"stem":32},"Dashboard","\u002Fdocs\u002Fporwr\u002Fdashboard","1.docs\u002F2.porwr\u002F03.dashboard",{"title":34,"path":35,"stem":36},"Key Management","\u002Fdocs\u002Fporwr\u002Fkeys","1.docs\u002F2.porwr\u002F04.keys",{"title":38,"path":39,"stem":40},"Profile Management","\u002Fdocs\u002Fporwr\u002Fprofile","1.docs\u002F2.porwr\u002F05.profile",{"title":42,"path":43,"stem":44},"Relay Management","\u002Fdocs\u002Fporwr\u002Frelay","1.docs\u002F2.porwr\u002F06.relay",{"title":46,"path":47,"stem":48},"Messaging","\u002Fdocs\u002Fporwr\u002Fmessaging","1.docs\u002F2.porwr\u002F07.messaging",{"title":50,"path":51,"stem":52},"Media Management","\u002Fdocs\u002Fporwr\u002Fmedia","1.docs\u002F2.porwr\u002F08.media",{"title":54,"path":55,"stem":56},"Wallet Management","\u002Fdocs\u002Fporwr\u002Fwallet","1.docs\u002F2.porwr\u002F09.wallet",{"title":58,"path":59,"stem":60},"Extension Settings","\u002Fdocs\u002Fporwr\u002Fsettings","1.docs\u002F2.porwr\u002F10.settings","i-lucide-puzzle",{"title":63,"path":64,"stem":65,"children":66,"icon":92},"Symudol","\u002Fdocs\u002Fsymudol","1.docs\u002F3.symudol\u002F1.index",[67,69,72,76,80,84,88],{"title":68,"path":64,"stem":65,"icon":10},"What is Symudol",{"title":12,"path":70,"stem":71},"\u002Fdocs\u002Fsymudol\u002Finstallation","1.docs\u002F3.symudol\u002F2.installation",{"title":73,"path":74,"stem":75},"Your vault","\u002Fdocs\u002Fsymudol\u002Fvault","1.docs\u002F3.symudol\u002F3.vault",{"title":77,"path":78,"stem":79},"Accounts and profile","\u002Fdocs\u002Fsymudol\u002Faccounts","1.docs\u002F3.symudol\u002F4.accounts",{"title":81,"path":82,"stem":83},"Approving requests","\u002Fdocs\u002Fsymudol\u002Fapproving-requests","1.docs\u002F3.symudol\u002F5.approving-requests",{"title":85,"path":86,"stem":87},"Remote apps (NIP-46)","\u002Fdocs\u002Fsymudol\u002Fremote-apps","1.docs\u002F3.symudol\u002F6.remote-apps",{"title":89,"path":90,"stem":91},"Settings","\u002Fdocs\u002Fsymudol\u002Fsettings","1.docs\u002F3.symudol\u002F7.settings","i-lucide-smartphone",{"title":94,"path":95,"stem":96,"children":97,"icon":147},"Bancwr","\u002Fdocs\u002Fbancwr","1.docs\u002F4.bancwr\u002F01.index",[98,100,103,107,111,115,119,123,127,131,135,139,143],{"title":99,"path":95,"stem":96,"icon":10},"What is Bancwr",{"title":12,"path":101,"stem":102},"\u002Fdocs\u002Fbancwr\u002Finstallation","1.docs\u002F4.bancwr\u002F02.installation",{"title":104,"path":105,"stem":106},"Configuring the URLs","\u002Fdocs\u002Fbancwr\u002Furls","1.docs\u002F4.bancwr\u002F03.urls",{"title":108,"path":109,"stem":110},"First administrator and signing in","\u002Fdocs\u002Fbancwr\u002Ffirst-administrator","1.docs\u002F4.bancwr\u002F04.first-administrator",{"title":112,"path":113,"stem":114},"Protecting the bunker key","\u002Fdocs\u002Fbancwr\u002Fprotecting-the-key","1.docs\u002F4.bancwr\u002F05.protecting-the-key",{"title":116,"path":117,"stem":118},"Team and roles","\u002Fdocs\u002Fbancwr\u002Fteam","1.docs\u002F4.bancwr\u002F06.team",{"title":120,"path":121,"stem":122},"Signing identities","\u002Fdocs\u002Fbancwr\u002Fsigning-identities","1.docs\u002F4.bancwr\u002F07.signing-identities",{"title":124,"path":125,"stem":126},"Connecting apps","\u002Fdocs\u002Fbancwr\u002Fconnecting-apps","1.docs\u002F4.bancwr\u002F08.connecting-apps",{"title":128,"path":129,"stem":130},"Approval before signing","\u002Fdocs\u002Fbancwr\u002Fapproval-before-signing","1.docs\u002F4.bancwr\u002F09.approval-before-signing",{"title":132,"path":133,"stem":134},"Profile, follows and relays","\u002Fdocs\u002Fbancwr\u002Fprofile-follows-relays","1.docs\u002F4.bancwr\u002F10.profile-follows-relays",{"title":136,"path":137,"stem":138},"Health, versions and logs","\u002Fdocs\u002Fbancwr\u002Fhealth-and-logs","1.docs\u002F4.bancwr\u002F11.health-and-logs",{"title":140,"path":141,"stem":142},"Backup and restore","\u002Fdocs\u002Fbancwr\u002Fbackup-and-restore","1.docs\u002F4.bancwr\u002F12.backup-and-restore",{"title":144,"path":145,"stem":146},"Updating","\u002Fdocs\u002Fbancwr\u002Fupdating","1.docs\u002F4.bancwr\u002F13.updating","i-lucide-server",{"id":149,"title":140,"body":150,"description":238,"extension":1268,"meta":1269,"navigation":577,"path":141,"seo":1270,"stem":142,"__hash__":1272},"docs\u002F1.docs\u002F4.bancwr\u002F12.backup-and-restore.md",{"type":151,"value":152,"toc":1249},"minimark",[153,158,166,189,192,199,204,207,225,228,232,326,332,339,342,345,349,352,367,530,538,542,551,556,594,599,646,649,695,701,718,731,735,741,749,753,761,768,776,872,885,895,902,905,911,931,934,938,1050,1054,1059,1062,1112,1115,1160,1166,1170,1173,1176,1190,1193,1208,1211,1225,1228,1232,1235,1245],[154,155,157],"h2",{"id":156},"what-a-backup-holds","What a backup holds",[159,160,161,165],"p",{},[162,163,164],"code",{},"bunker backup"," writes one encrypted archive while the bunker keeps running. It holds:",[167,168,169,182],"ul",{},[170,171,172,173,176,177,181],"li",{},"a consistent snapshot of the database, ",[162,174,175],{},".\u002Fdata\u002Fbancwr.db",": the team and their roles, connection tokens (only a hash of each secret) and connected apps, the signing log, every identity, and the bunker relays chosen under ",[178,179,180],"strong",{},"Config",",",[170,183,184,185,188],{},"the encrypted key file, ",[162,186,187],{},".\u002Fdata\u002Fbunker-key.enc",", exactly as it is on disk.",[159,190,191],{},"It does not hold the root credential, the backup passphrase, the proxy secret or anyone's session.",[159,193,194,195,198],{},"The archive is encrypted under the backup passphrase in ",[162,196,197],{},".\u002Fsecrets\u002Fbancwr_backup_key",". Inside it, the bunker's key is still encrypted under the root credential, so an archive and its passphrase together are not the key. The archive is also authenticated under the root credential (with an HMAC), so a restore can tell it was made by this bunker and not altered since.",[200,201,203],"h3",{"id":202},"what-you-need-to-recover","What you need to recover",[159,205,206],{},"To recover a bunker you need 3 things. Keep each apart from the others:",[208,209,210,213,218],"ol",{},[170,211,212],{},"an archive,",[170,214,215,216,181],{},"the backup passphrase, ",[162,217,197],{},[170,219,220,221,224],{},"the root credential, ",[162,222,223],{},".\u002Fsecrets\u002Fbancwr_root_key",".",[159,226,227],{},"The database names every member and every connected app, so keep archives as private as the server.",[154,229,231],{"id":230},"take-a-backup","Take a backup",[233,234,239],"pre",{"className":235,"code":236,"language":237,"meta":238,"style":238},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mkdir -p -m 700 backups\n(umask 077; podman exec bancwr-bunker bunker backup > \"backups\u002Fbancwr-$(date +%F).bcwr\")\n","bash","",[162,240,241,264],{"__ignoreMap":238},[242,243,246,250,254,257,261],"span",{"class":244,"line":245},"line",1,[242,247,249],{"class":248},"sBMFI","mkdir",[242,251,253],{"class":252},"sfazB"," -p",[242,255,256],{"class":252}," -m",[242,258,260],{"class":259},"sbssI"," 700",[242,262,263],{"class":252}," backups\n",[242,265,267,271,275,278,281,284,287,290,293,296,299,302,305,308,311,314,317,320,323],{"class":244,"line":266},2,[242,268,270],{"class":269},"sMK4o","(",[242,272,274],{"class":273},"s2Zo4","umask",[242,276,277],{"class":259}," 077",[242,279,280],{"class":269},";",[242,282,283],{"class":248}," podman",[242,285,286],{"class":252}," exec",[242,288,289],{"class":252}," bancwr-bunker",[242,291,292],{"class":252}," bunker",[242,294,295],{"class":252}," backup",[242,297,298],{"class":269}," >",[242,300,301],{"class":269}," \"",[242,303,304],{"class":252},"backups\u002Fbancwr-",[242,306,307],{"class":269},"$(",[242,309,310],{"class":248},"date",[242,312,313],{"class":252}," +%F",[242,315,316],{"class":269},")",[242,318,319],{"class":252},".bcwr",[242,321,322],{"class":269},"\"",[242,324,325],{"class":269},")\n",[159,327,328,329,224],{},"With Docker, use ",[162,330,331],{},"docker exec",[159,333,334,335,338],{},"The archive goes to standard output, and a short summary to the terminal: the bunker's ",[162,336,337],{},"npub",", and how many members, connections and signing log entries it holds.",[159,340,341],{},"If the command fails, it exits with an error and says why, and the file it was written to is empty or incomplete. Delete that file.",[159,343,344],{},"Bancwr does not copy archives anywhere. Copy them off the server yourself, to somewhere the backup passphrase is not.",[154,346,348],{"id":347},"scheduled-backups","Scheduled backups",[159,350,351],{},"A small script, run daily, keeping 30 days of archives.",[159,353,354,355,358,359,362,363,366],{},"Save this as ",[162,356,357],{},"bancwr-backup.sh"," beside ",[162,360,361],{},"compose.yaml",", and make it executable with ",[162,364,365],{},"chmod 700 bancwr-backup.sh",":",[233,368,372],{"className":369,"code":370,"language":371,"meta":238,"style":238},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","#!\u002Fbin\u002Fsh\nset -eu\numask 077\ncd \"$(dirname \"$0\")\"\nmkdir -p backups\nname=\"backups\u002Fbancwr-$(date +%F-%H%M).bcwr\"\npodman exec bancwr-bunker bunker backup > \"$name.part\"\nmv \"$name.part\" \"$name\"\nfind backups -name 'bancwr-*.bcwr' -mtime +30 -delete\n","sh",[162,373,374,380,388,396,417,426,454,480,500],{"__ignoreMap":238},[242,375,376],{"class":244,"line":245},[242,377,379],{"class":378},"sHwdD","#!\u002Fbin\u002Fsh\n",[242,381,382,385],{"class":244,"line":266},[242,383,384],{"class":273},"set",[242,386,387],{"class":252}," -eu\n",[242,389,391,393],{"class":244,"line":390},3,[242,392,274],{"class":273},[242,394,395],{"class":259}," 077\n",[242,397,399,402,405,408,410,414],{"class":244,"line":398},4,[242,400,401],{"class":273},"cd",[242,403,404],{"class":269}," \"$(",[242,406,407],{"class":248},"dirname",[242,409,301],{"class":269},[242,411,413],{"class":412},"sHdIc","$0",[242,415,416],{"class":269},"\")\"\n",[242,418,420,422,424],{"class":244,"line":419},5,[242,421,249],{"class":248},[242,423,253],{"class":252},[242,425,263],{"class":252},[242,427,429,433,436,438,440,442,444,447,449,451],{"class":244,"line":428},6,[242,430,432],{"class":431},"sTEyZ","name",[242,434,435],{"class":269},"=",[242,437,322],{"class":269},[242,439,304],{"class":252},[242,441,307],{"class":269},[242,443,310],{"class":248},[242,445,446],{"class":252}," +%F-%H%M",[242,448,316],{"class":269},[242,450,319],{"class":252},[242,452,453],{"class":269},"\"\n",[242,455,457,460,462,464,466,468,470,472,475,478],{"class":244,"line":456},7,[242,458,459],{"class":248},"podman",[242,461,286],{"class":252},[242,463,289],{"class":252},[242,465,292],{"class":252},[242,467,295],{"class":252},[242,469,298],{"class":269},[242,471,301],{"class":269},[242,473,474],{"class":431},"$name",[242,476,477],{"class":252},".part",[242,479,453],{"class":269},[242,481,483,486,488,490,492,494,496,498],{"class":244,"line":482},8,[242,484,485],{"class":248},"mv",[242,487,301],{"class":269},[242,489,474],{"class":431},[242,491,477],{"class":252},[242,493,322],{"class":269},[242,495,301],{"class":269},[242,497,474],{"class":431},[242,499,453],{"class":269},[242,501,503,506,509,512,515,518,521,524,527],{"class":244,"line":502},9,[242,504,505],{"class":248},"find",[242,507,508],{"class":252}," backups",[242,510,511],{"class":252}," -name",[242,513,514],{"class":269}," '",[242,516,517],{"class":252},"bancwr-*.bcwr",[242,519,520],{"class":269},"'",[242,522,523],{"class":252}," -mtime",[242,525,526],{"class":252}," +30",[242,528,529],{"class":252}," -delete\n",[159,531,328,532,534,535,537],{},[162,533,331],{},". An archive only gets its final name once the backup succeeds, so a failed run leaves a ",[162,536,477],{}," file, never an archive that looks complete.",[200,539,541],{"id":540},"with-a-systemd-timer","With a systemd timer",[159,543,544,545,548,549,224],{},"With rootless Podman, run it as a systemd user timer. Adjust ",[162,546,547],{},"%h\u002Fbancwr"," to the directory that holds your ",[162,550,361],{},[159,552,553,366],{},[162,554,555],{},"~\u002F.config\u002Fsystemd\u002Fuser\u002Fbancwr-backup.service",[233,557,561],{"className":558,"code":559,"language":560,"meta":238,"style":238},"language-ini shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[Unit]\nDescription=Back up the Bancwr bunker\n\n[Service]\nType=oneshot\nExecStart=%h\u002Fbancwr\u002Fbancwr-backup.sh\n","ini",[162,562,563,568,573,579,584,589],{"__ignoreMap":238},[242,564,565],{"class":244,"line":245},[242,566,567],{},"[Unit]\n",[242,569,570],{"class":244,"line":266},[242,571,572],{},"Description=Back up the Bancwr bunker\n",[242,574,575],{"class":244,"line":390},[242,576,578],{"emptyLinePlaceholder":577},true,"\n",[242,580,581],{"class":244,"line":398},[242,582,583],{},"[Service]\n",[242,585,586],{"class":244,"line":419},[242,587,588],{},"Type=oneshot\n",[242,590,591],{"class":244,"line":428},[242,592,593],{},"ExecStart=%h\u002Fbancwr\u002Fbancwr-backup.sh\n",[159,595,596,366],{},[162,597,598],{},"~\u002F.config\u002Fsystemd\u002Fuser\u002Fbancwr-backup.timer",[233,600,602],{"className":558,"code":601,"language":560,"meta":238,"style":238},"[Unit]\nDescription=Back up the Bancwr bunker daily\n\n[Timer]\nOnCalendar=*-*-* 03:15:00\nPersistent=true\n\n[Install]\nWantedBy=timers.target\n",[162,603,604,608,613,617,622,627,632,636,641],{"__ignoreMap":238},[242,605,606],{"class":244,"line":245},[242,607,567],{},[242,609,610],{"class":244,"line":266},[242,611,612],{},"Description=Back up the Bancwr bunker daily\n",[242,614,615],{"class":244,"line":390},[242,616,578],{"emptyLinePlaceholder":577},[242,618,619],{"class":244,"line":398},[242,620,621],{},"[Timer]\n",[242,623,624],{"class":244,"line":419},[242,625,626],{},"OnCalendar=*-*-* 03:15:00\n",[242,628,629],{"class":244,"line":428},[242,630,631],{},"Persistent=true\n",[242,633,634],{"class":244,"line":456},[242,635,578],{"emptyLinePlaceholder":577},[242,637,638],{"class":244,"line":482},[242,639,640],{},"[Install]\n",[242,642,643],{"class":244,"line":502},[242,644,645],{},"WantedBy=timers.target\n",[159,647,648],{},"Then turn it on:",[233,650,652],{"className":235,"code":651,"language":237,"meta":238,"style":238},"systemctl --user daemon-reload\nsystemctl --user enable --now bancwr-backup.timer\nloginctl enable-linger \"$USER\"\n",[162,653,654,665,680],{"__ignoreMap":238},[242,655,656,659,662],{"class":244,"line":245},[242,657,658],{"class":248},"systemctl",[242,660,661],{"class":252}," --user",[242,663,664],{"class":252}," daemon-reload\n",[242,666,667,669,671,674,677],{"class":244,"line":266},[242,668,658],{"class":248},[242,670,661],{"class":252},[242,672,673],{"class":252}," enable",[242,675,676],{"class":252}," --now",[242,678,679],{"class":252}," bancwr-backup.timer\n",[242,681,682,685,688,690,693],{"class":244,"line":390},[242,683,684],{"class":248},"loginctl",[242,686,687],{"class":252}," enable-linger",[242,689,301],{"class":269},[242,691,692],{"class":431},"$USER",[242,694,453],{"class":269},[159,696,697,700],{},[162,698,699],{},"enable-linger"," keeps the timer running while you are logged out. Check the last run with:",[233,702,704],{"className":235,"code":703,"language":237,"meta":238,"style":238},"systemctl --user status bancwr-backup.service\n",[162,705,706],{"__ignoreMap":238},[242,707,708,710,712,715],{"class":244,"line":245},[242,709,658],{"class":248},[242,711,661],{"class":252},[242,713,714],{"class":252}," status",[242,716,717],{"class":252}," bancwr-backup.service\n",[159,719,720,721,724,725,727,728,224],{},"With Docker, put the same two units in ",[162,722,723],{},"\u002Fetc\u002Fsystemd\u002Fsystem\u002F",", and use ",[162,726,658],{}," without ",[162,729,730],{},"--user",[200,732,734],{"id":733},"with-cron","With cron",[159,736,737,738,366],{},"Or run it from cron, with ",[162,739,740],{},"crontab -e",[233,742,747],{"className":743,"code":745,"language":746,"meta":238},[744],"language-text","15 3 * * * $HOME\u002Fbancwr\u002Fbancwr-backup.sh\n","text",[162,748,745],{"__ignoreMap":238},[200,750,752],{"id":751},"test-your-backups","Test your backups",[159,754,755,756,224],{},"Now and then, restore one of these archives into a spare directory, to check you can. See ",[757,758,760],"a",{"href":759},"#restoring-the-bunker","Restoring the bunker",[154,762,764,765],{"id":763},"a-cold-copy-of-data","A cold copy of ",[162,766,767],{},".\u002Fdata",[159,769,770,772,773,775],{},[162,771,164],{}," is the supported way. If you cannot use it, copy ",[162,774,767],{}," with the bunker stopped. Apps cannot sign while it is stopped.",[233,777,779],{"className":235,"code":778,"language":237,"meta":238,"style":238},"podman compose stop bunker\nmkdir -p -m 700 backups\nmkdir -m 700 \"backups\u002F$(date +%F)\"\npodman unshare cp -a data\u002F. \"backups\u002F$(date +%F)\u002F\"\npodman compose start bunker\n",[162,780,781,794,806,828,861],{"__ignoreMap":238},[242,782,783,785,788,791],{"class":244,"line":245},[242,784,459],{"class":248},[242,786,787],{"class":252}," compose",[242,789,790],{"class":252}," stop",[242,792,793],{"class":252}," bunker\n",[242,795,796,798,800,802,804],{"class":244,"line":266},[242,797,249],{"class":248},[242,799,253],{"class":252},[242,801,256],{"class":252},[242,803,260],{"class":259},[242,805,263],{"class":252},[242,807,808,810,812,814,816,819,821,823,825],{"class":244,"line":390},[242,809,249],{"class":248},[242,811,256],{"class":252},[242,813,260],{"class":259},[242,815,301],{"class":269},[242,817,818],{"class":252},"backups\u002F",[242,820,307],{"class":269},[242,822,310],{"class":248},[242,824,313],{"class":252},[242,826,827],{"class":269},")\"\n",[242,829,830,832,835,838,841,844,846,848,850,852,854,856,859],{"class":244,"line":398},[242,831,459],{"class":248},[242,833,834],{"class":252}," unshare",[242,836,837],{"class":252}," cp",[242,839,840],{"class":252}," -a",[242,842,843],{"class":252}," data\u002F.",[242,845,301],{"class":269},[242,847,818],{"class":252},[242,849,307],{"class":269},[242,851,310],{"class":248},[242,853,313],{"class":252},[242,855,316],{"class":269},[242,857,858],{"class":252},"\u002F",[242,860,453],{"class":269},[242,862,863,865,867,870],{"class":244,"line":419},[242,864,459],{"class":248},[242,866,787],{"class":252},[242,868,869],{"class":252}," start",[242,871,793],{"class":252},[159,873,328,874,877,878,881,882,224],{},[162,875,876],{},"docker compose",", and ",[162,879,880],{},"sudo cp -a"," in place of ",[162,883,884],{},"podman unshare cp -a",[159,886,887,888,891,892,224],{},"Never copy ",[162,889,890],{},"bancwr.db"," on its own from a running bunker. It runs in WAL mode, and recent changes are in ",[162,893,894],{},"bancwr.db-wal",[159,896,897,898,901],{},"A cold copy is not encrypted, apart from the key file. Restoring it is copying it back, and that brings back every connection and token as it was, including any revoked since. After restoring a cold copy, revoke under ",[178,899,900],{},"Connections"," every app and token you had shut out.",[154,903,760],{"id":904},"restoring-the-bunker",[159,906,907,910],{},[162,908,909],{},"bunker restore"," reads an archive from standard input. Before it writes anything, it checks that:",[167,912,913,916,919,922,925,928],{},[170,914,915],{},"the backup passphrase decrypts the archive,",[170,917,918],{},"the key file in it matches the archive's public key,",[170,920,921],{},"the root credential decrypts that key, so the restored bunker will unlock,",[170,923,924],{},"the archive was made under the same root credential, and not altered since,",[170,926,927],{},"the database in it is sound, and not from a newer Bancwr,",[170,929,930],{},"the data directory holds no database and no key file.",[159,932,933],{},"So a restore needs the same root credential that made the backup. If any check fails, it says why and writes nothing.",[200,935,937],{"id":936},"on-a-clean-server","On a clean server",[208,939,940,968,1017],{},[170,941,942,943,945,946,949,950,945,953,956,957,945,959,962,963,967],{},"Put ",[162,944,361],{}," and ",[162,947,948],{},".env"," in place, as for a new installation. Put back the two secrets from where you kept them, ",[162,951,952],{},"secrets\u002Fbancwr_root_key",[162,954,955],{},"secrets\u002Fbancwr_backup_key",". Give them, an empty ",[162,958,767],{},[162,960,961],{},".\u002Fsessions"," to user ID 65532, as ",[757,964,966],{"href":965},"\u002Fdocs\u002Fbancwr\u002Finstallation#_4-hand-the-files-to-the-bunkers-user","Hand the files to the bunker's user"," shows. There is no plain key to import.",[170,969,970,971,1005,328,1008,1010,1011,1013,1014,1016],{},"Restore:",[233,972,974],{"className":235,"code":973,"language":237,"meta":238,"style":238},"podman compose run --rm --no-deps -T bunker restore \u003C backups\u002Fbancwr-2026-11-13.bcwr\n",[162,975,976],{"__ignoreMap":238},[242,977,978,980,982,985,988,991,994,996,999,1002],{"class":244,"line":245},[242,979,459],{"class":248},[242,981,787],{"class":252},[242,983,984],{"class":252}," run",[242,986,987],{"class":252}," --rm",[242,989,990],{"class":252}," --no-deps",[242,992,993],{"class":252}," -T",[242,995,292],{"class":252},[242,997,998],{"class":252}," restore",[242,1000,1001],{"class":269}," \u003C",[242,1003,1004],{"class":252}," backups\u002Fbancwr-2026-11-13.bcwr\n",[1006,1007],"br",{},[162,1009,876],{},". It prints the bunker's ",[162,1012,337],{},", how many members are back, and how many connections and tokens it revoked. Check the ",[162,1015,337],{}," is the bunker's.",[170,1018,1019,1020],{},"Start the bunker and check it:",[233,1021,1023],{"className":235,"code":1022,"language":237,"meta":238,"style":238},"podman compose up -d\npodman exec bancwr-bunker bunker healthcheck\n",[162,1024,1025,1037],{"__ignoreMap":238},[242,1026,1027,1029,1031,1034],{"class":244,"line":245},[242,1028,459],{"class":248},[242,1030,787],{"class":252},[242,1032,1033],{"class":252}," up",[242,1035,1036],{"class":252}," -d\n",[242,1038,1039,1041,1043,1045,1047],{"class":244,"line":266},[242,1040,459],{"class":248},[242,1042,286],{"class":252},[242,1044,289],{"class":252},[242,1046,292],{"class":252},[242,1048,1049],{"class":252}," healthcheck\n",[200,1051,1053],{"id":1052},"replacing-a-bunkers-data","Replacing a bunker's data",[159,1055,1056,1057,224],{},"A restore never writes over existing data. To roll a bunker back, stop it and move its data aside first, then restore into a new, empty ",[162,1058,767],{},[159,1060,1061],{},"With rootless Podman:",[233,1063,1065],{"className":235,"code":1064,"language":237,"meta":238,"style":238},"podman compose stop bunker\nmv data data.before-restore\nmkdir -m 700 data\npodman unshare chown 65532:65532 data\n",[162,1066,1067,1077,1087,1098],{"__ignoreMap":238},[242,1068,1069,1071,1073,1075],{"class":244,"line":245},[242,1070,459],{"class":248},[242,1072,787],{"class":252},[242,1074,790],{"class":252},[242,1076,793],{"class":252},[242,1078,1079,1081,1084],{"class":244,"line":266},[242,1080,485],{"class":248},[242,1082,1083],{"class":252}," data",[242,1085,1086],{"class":252}," data.before-restore\n",[242,1088,1089,1091,1093,1095],{"class":244,"line":390},[242,1090,249],{"class":248},[242,1092,256],{"class":252},[242,1094,260],{"class":259},[242,1096,1097],{"class":252}," data\n",[242,1099,1100,1102,1104,1107,1110],{"class":244,"line":398},[242,1101,459],{"class":248},[242,1103,834],{"class":252},[242,1105,1106],{"class":252}," chown",[242,1108,1109],{"class":252}," 65532:65532",[242,1111,1097],{"class":252},[159,1113,1114],{},"With Docker:",[233,1116,1118],{"className":235,"code":1117,"language":237,"meta":238,"style":238},"docker compose stop bunker\nmv data data.before-restore\nmkdir -m 700 data\nsudo chown 65532:65532 data\n",[162,1119,1120,1131,1139,1149],{"__ignoreMap":238},[242,1121,1122,1125,1127,1129],{"class":244,"line":245},[242,1123,1124],{"class":248},"docker",[242,1126,787],{"class":252},[242,1128,790],{"class":252},[242,1130,793],{"class":252},[242,1132,1133,1135,1137],{"class":244,"line":266},[242,1134,485],{"class":248},[242,1136,1083],{"class":252},[242,1138,1086],{"class":252},[242,1140,1141,1143,1145,1147],{"class":244,"line":390},[242,1142,249],{"class":248},[242,1144,256],{"class":252},[242,1146,260],{"class":259},[242,1148,1097],{"class":252},[242,1150,1151,1154,1156,1158],{"class":244,"line":398},[242,1152,1153],{"class":248},"sudo",[242,1155,1106],{"class":252},[242,1157,1109],{"class":252},[242,1159,1097],{"class":252},[159,1161,1162,1163,224],{},"Then follow steps 2 and 3 above. Once you are sure the restore is good, delete ",[162,1164,1165],{},"data.before-restore",[154,1167,1169],{"id":1168},"what-a-restore-keeps-and-what-it-revokes","What a restore keeps, and what it revokes",[159,1171,1172],{},"A restore revokes every connected app and every unused connection token before the bunker starts again. So an app or token you shut out after the backup cannot come back with it.",[159,1174,1175],{},"Kept, as they were at the backup:",[167,1177,1178,1181,1184,1187],{},[170,1179,1180],{},"members and their roles,",[170,1182,1183],{},"the identities and their grants,",[170,1185,1186],{},"the signing log and the audit events. The restore adds one, saying what it revoked and when the backup was taken,",[170,1188,1189],{},"the bunker relays and the log retention policy.",[159,1191,1192],{},"Revoked:",[167,1194,1195,1205],{},[170,1196,1197,1198,1200,1201,1204],{},"every connected app. Each shows under ",[178,1199,900],{}," as ended with ",[178,1202,1203],{},"The bunker was restored from a backup",", and needs a new connection token to connect again,",[170,1206,1207],{},"every connection token not yet used.",[159,1209,1210],{},"Lost: anything since the backup, such as members added, roles changed and signatures made.",[1212,1213,1214],"warning",{},[159,1215,1216,1217,1220,1221,1224],{},"Members removed, and roles lowered, since the backup come back with it. Before you leave the bunker running, sign in as an administrator and, under ",[178,1218,1219],{},"Team",", remove anyone who should no longer be there, and set any role back with the member's ",[178,1222,1223],{},"Role"," select.",[159,1226,1227],{},"Sessions are not in the database, so a restore does not sign anyone out. Each signed-in member's role is read from the restored database on their next request.",[154,1229,1231],{"id":1230},"older-archives","Older archives",[159,1233,1234],{},"Archives are in format version 2. A version 1 archive, made before archives were authenticated under the root credential, is refused. Take a new backup.",[159,1236,1237,1238,1240,1241,1244],{},"A copy of ",[162,1239,767],{}," made by a build from before the key was kept out of the database may hold the ",[162,1242,1243],{},"nsec"," in plain text. Treat such a copy as a copy of the key, or delete it.",[1246,1247,1248],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":238,"searchDepth":266,"depth":266,"links":1250},[1251,1254,1255,1260,1262,1266,1267],{"id":156,"depth":266,"text":157,"children":1252},[1253],{"id":202,"depth":390,"text":203},{"id":230,"depth":266,"text":231},{"id":347,"depth":266,"text":348,"children":1256},[1257,1258,1259],{"id":540,"depth":390,"text":541},{"id":733,"depth":390,"text":734},{"id":751,"depth":390,"text":752},{"id":763,"depth":266,"text":1261},"A cold copy of .\u002Fdata",{"id":904,"depth":266,"text":760,"children":1263},[1264,1265],{"id":936,"depth":390,"text":937},{"id":1052,"depth":390,"text":1053},{"id":1168,"depth":266,"text":1169},{"id":1230,"depth":266,"text":1231},"md",{},{"description":1271,"title":140},"Back up Bancwr with bunker backup, schedule it with a systemd timer or cron, keep the backup passphrase apart, and restore with bunker restore, which revokes every connected app.","HC16hCpUD4TQlZQkeerQRebGRAHtH7XyqzMGKUtVeHE",[1274,1275],{"title":136,"path":137,"stem":138,"description":238,"children":-1},{"title":144,"path":145,"stem":146,"description":238,"children":-1},1795083910452]