[{"data":1,"prerenderedAt":551},["ShallowReactive",2],{"docs-navigation":3,"docs:\u002Fdocs\u002Fself-hosting\u002Fupdating":235,"docs-surround:\u002Fdocs\u002Fself-hosting\u002Fupdating":546},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","\u002Fdocs","docs",[9,13,37,55,70,128,146,191,217],{"title":10,"path":6,"stem":11,"icon":12},"Hubstruct documentation","docs\u002Findex","book-open",{"title":14,"icon":15,"path":16,"stem":17,"children":18,"page":36},"Getting started","rocket","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[19,24,28,32],{"title":20,"path":21,"stem":22,"icon":23},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction",null,{"title":25,"path":26,"stem":27,"icon":23},"Requirements","\u002Fdocs\u002Fgetting-started\u002Frequirements","docs\u002F1.getting-started\u002F2.requirements",{"title":29,"path":30,"stem":31,"icon":23},"Quick start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F1.getting-started\u002F3.quick-start",{"title":33,"path":34,"stem":35,"icon":23},"First steps","\u002Fdocs\u002Fgetting-started\u002Ffirst-steps","docs\u002F1.getting-started\u002F4.first-steps",false,{"title":38,"icon":39,"path":40,"stem":41,"children":42,"page":36},"Concepts","lightbulb","\u002Fdocs\u002Fconcepts","docs\u002F2.concepts",[43,47,51],{"title":44,"path":45,"stem":46,"icon":23},"How it works","\u002Fdocs\u002Fconcepts\u002Fhow-it-works","docs\u002F2.concepts\u002F1.how-it-works",{"title":48,"path":49,"stem":50,"icon":23},"Processing steps","\u002Fdocs\u002Fconcepts\u002Fprocessing","docs\u002F2.concepts\u002F2.processing",{"title":52,"path":53,"stem":54,"icon":23},"Media","\u002Fdocs\u002Fconcepts\u002Fmedia","docs\u002F2.concepts\u002F3.media",{"title":56,"path":57,"stem":58,"children":59,"icon":69},"Libraries","\u002Fdocs\u002Flibraries","docs\u002F3.libraries\u002F1.index",[60,61,65],{"title":56,"path":57,"stem":58,"icon":23},{"title":62,"path":63,"stem":64,"icon":23},"Storage","\u002Fdocs\u002Flibraries\u002Fs3","docs\u002F3.libraries\u002F3.s3",{"title":66,"path":67,"stem":68,"icon":23},"Uploading","\u002Fdocs\u002Flibraries\u002Fuploading","docs\u002F3.libraries\u002F4.uploading","layer-group",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":36},"Features","wand-magic-sparkles","\u002Fdocs\u002Ffeatures","docs\u002F4.features",[76,80,84,88,92,96,100,104,108,112,116,120,124],{"title":77,"path":78,"stem":79,"icon":23},"Browsing","\u002Fdocs\u002Ffeatures\u002Fbrowsing","docs\u002F4.features\u002F01.browsing",{"title":81,"path":82,"stem":83,"icon":23},"Search","\u002Fdocs\u002Ffeatures\u002Fsearch","docs\u002F4.features\u002F02.search",{"title":85,"path":86,"stem":87,"icon":23},"Tags","\u002Fdocs\u002Ffeatures\u002Ftags","docs\u002F4.features\u002F03.tags",{"title":89,"path":90,"stem":91,"icon":23},"Albums","\u002Fdocs\u002Ffeatures\u002Falbums","docs\u002F4.features\u002F04.albums",{"title":93,"path":94,"stem":95,"icon":23},"People and faces","\u002Fdocs\u002Ffeatures\u002Fpeople","docs\u002F4.features\u002F05.people",{"title":97,"path":98,"stem":99,"icon":23},"Groups","\u002Fdocs\u002Ffeatures\u002Fgroups","docs\u002F4.features\u002F06.groups",{"title":101,"path":102,"stem":103,"icon":23},"Duplicates and stacks","\u002Fdocs\u002Ffeatures\u002Fduplicates-and-stacks","docs\u002F4.features\u002F07.duplicates-and-stacks",{"title":105,"path":106,"stem":107,"icon":23},"NSFW","\u002Fdocs\u002Ffeatures\u002Fnsfw","docs\u002F4.features\u002F08.nsfw",{"title":109,"path":110,"stem":111,"icon":23},"Trash","\u002Fdocs\u002Ffeatures\u002Ftrash","docs\u002F4.features\u002F09.trash",{"title":113,"path":114,"stem":115,"icon":23},"Home and the dashboard","\u002Fdocs\u002Ffeatures\u002Fhome-and-dashboard","docs\u002F4.features\u002F10.home-and-dashboard",{"title":117,"path":118,"stem":119,"icon":23},"Live updates and offline","\u002Fdocs\u002Ffeatures\u002Flive-updates","docs\u002F4.features\u002F11.live-updates",{"title":121,"path":122,"stem":123,"icon":23},"Appearance and the app","\u002Fdocs\u002Ffeatures\u002Fappearance","docs\u002F4.features\u002F12.appearance",{"title":125,"path":126,"stem":127,"icon":23},"Places","\u002Fdocs\u002Ffeatures\u002Fplaces","docs\u002F4.features\u002F13.places",{"title":129,"icon":130,"path":131,"stem":132,"children":133,"page":36},"Administration","sliders","\u002Fdocs\u002Fadministration","docs\u002F5.administration",[134,138,142],{"title":135,"path":136,"stem":137,"icon":23},"Users and sign-in","\u002Fdocs\u002Fadministration\u002Fusers-and-sign-in","docs\u002F5.administration\u002F1.users-and-sign-in",{"title":139,"path":140,"stem":141,"icon":23},"API keys","\u002Fdocs\u002Fadministration\u002Fapi-keys","docs\u002F5.administration\u002F2.api-keys",{"title":143,"path":144,"stem":145,"icon":23},"Processing settings","\u002Fdocs\u002Fadministration\u002Fprocessing-settings","docs\u002F5.administration\u002F3.processing-settings",{"title":147,"icon":148,"path":149,"stem":150,"children":151,"page":36},"Self-hosting","server","\u002Fdocs\u002Fself-hosting","docs\u002F6.self-hosting",[152,156,160,164,167,171,175,179,183,187],{"title":153,"path":154,"stem":155,"icon":23},"Architecture","\u002Fdocs\u002Fself-hosting\u002Farchitecture","docs\u002F6.self-hosting\u002F1.architecture",{"title":157,"path":158,"stem":159,"icon":23},"Telemetry","\u002Fdocs\u002Fself-hosting\u002Ftelemetry","docs\u002F6.self-hosting\u002F10.telemetry",{"title":161,"path":162,"stem":163,"icon":23},"Sharing one GPU","\u002Fdocs\u002Fself-hosting\u002Fgpu","docs\u002F6.self-hosting\u002F2.gpu",{"title":62,"path":165,"stem":166,"icon":23},"\u002Fdocs\u002Fself-hosting\u002Fstorage","docs\u002F6.self-hosting\u002F3.storage",{"title":168,"path":169,"stem":170,"icon":23},"Backups","\u002Fdocs\u002Fself-hosting\u002Fbackups","docs\u002F6.self-hosting\u002F4.backups",{"title":172,"path":173,"stem":174,"icon":23},"Updating","\u002Fdocs\u002Fself-hosting\u002Fupdating","docs\u002F6.self-hosting\u002F5.updating",{"title":176,"path":177,"stem":178,"icon":23},"Scaling","\u002Fdocs\u002Fself-hosting\u002Fscaling","docs\u002F6.self-hosting\u002F6.scaling",{"title":180,"path":181,"stem":182,"icon":23},"HTTPS and a domain","\u002Fdocs\u002Fself-hosting\u002Freverse-proxy","docs\u002F6.self-hosting\u002F7.reverse-proxy",{"title":184,"path":185,"stem":186,"icon":23},"Troubleshooting","\u002Fdocs\u002Fself-hosting\u002Ftroubleshooting","docs\u002F6.self-hosting\u002F8.troubleshooting",{"title":188,"path":189,"stem":190,"icon":23},"The config file","\u002Fdocs\u002Fself-hosting\u002Fconfig-file","docs\u002F6.self-hosting\u002F9.config-file",{"title":192,"icon":193,"path":194,"stem":195,"children":196,"page":36},"Reference","book","\u002Fdocs\u002Freference","docs\u002F7.reference",[197,201,205,209,213],{"title":198,"path":199,"stem":200,"icon":23},"Environment variables","\u002Fdocs\u002Freference\u002Fenvironment","docs\u002F7.reference\u002F1.environment",{"title":202,"path":203,"stem":204,"icon":23},"Worker roles","\u002Fdocs\u002Freference\u002Fworker-roles","docs\u002F7.reference\u002F2.worker-roles",{"title":206,"path":207,"stem":208,"icon":23},"API","\u002Fdocs\u002Freference\u002Fapi","docs\u002F7.reference\u002F3.api",{"title":210,"path":211,"stem":212,"icon":23},"Keyboard shortcuts","\u002Fdocs\u002Freference\u002Fkeyboard-shortcuts","docs\u002F7.reference\u002F4.keyboard-shortcuts",{"title":214,"path":215,"stem":216,"icon":23},"Models","\u002Fdocs\u002Freference\u002Fmodels","docs\u002F7.reference\u002F5.models",{"title":218,"icon":219,"path":220,"stem":221,"children":222,"page":36},"Hubstruct Cloud","cloud","\u002Fdocs\u002Fcloud","docs\u002F8.cloud",[223,227,231],{"title":224,"path":225,"stem":226,"icon":23},"Getting started with the cloud","\u002Fdocs\u002Fcloud\u002Fgetting-started","docs\u002F8.cloud\u002F1.getting-started",{"title":228,"path":229,"stem":230,"icon":23},"Plans and billing","\u002Fdocs\u002Fcloud\u002Fplans-and-billing","docs\u002F8.cloud\u002F2.plans-and-billing",{"title":232,"path":233,"stem":234,"icon":23},"Moving between cloud and self-hosted","\u002Fdocs\u002Fcloud\u002Fmoving","docs\u002F8.cloud\u002F3.moving",{"id":236,"title":172,"body":237,"description":541,"extension":542,"eyebrow":147,"icon":23,"meta":543,"navigation":348,"path":173,"seo":544,"stem":174,"__hash__":545},"docs\u002Fdocs\u002F6.self-hosting\u002F5.updating.md",{"type":238,"value":239,"toc":534},"minimark",[240,249,253,256,390,404,407,433,437,440,443,447,458,473,476,480,483,507,511,514,527,530],[241,242,243,244,248],"p",{},"Updating Hubstruct means pulling its new images and starting them. The database is updated by the ",[245,246,247],"strong",{},"migrator"," on start.",[250,251,172],"h2",{"id":252},"updating",[241,254,255],{},"From the folder with your Compose file:",[257,258,263],"pre",{"className":259,"code":260,"language":261,"meta":262,"style":262},"language-bash shiki shiki-themes github-dark github-light","# 1. A fresh backup of the database, every time.\ndocker compose exec -T postgres \\\n  pg_dump -U tagging -d mediadb -Fc > backups\u002Fbefore-update-$(date +%F).dump\n\n# 2. The new images.\ndocker compose pull\n\n# 3. Start them.\ndocker compose up -d\n","bash","",[264,265,266,275,299,343,350,356,366,371,377],"code",{"__ignoreMap":262},[267,268,271],"span",{"class":269,"line":270},"line",1,[267,272,274],{"class":273},"si27w","# 1. A fresh backup of the database, every time.\n",[267,276,278,282,286,289,293,296],{"class":269,"line":277},2,[267,279,281],{"class":280},"sqoU-","docker",[267,283,285],{"class":284},"skb7c"," compose",[267,287,288],{"class":284}," exec",[267,290,292],{"class":291},"sTU5a"," -T",[267,294,295],{"class":284}," postgres",[267,297,298],{"class":291}," \\\n",[267,300,302,305,308,311,314,317,320,324,327,331,334,337,340],{"class":269,"line":301},3,[267,303,304],{"class":284},"  pg_dump",[267,306,307],{"class":291}," -U",[267,309,310],{"class":284}," tagging",[267,312,313],{"class":291}," -d",[267,315,316],{"class":284}," mediadb",[267,318,319],{"class":291}," -Fc",[267,321,323],{"class":322},"spKkM"," >",[267,325,326],{"class":284}," backups\u002Fbefore-update-",[267,328,330],{"class":329},"shWlK","$(",[267,332,333],{"class":280},"date",[267,335,336],{"class":284}," +%F",[267,338,339],{"class":329},")",[267,341,342],{"class":284},".dump\n",[267,344,346],{"class":269,"line":345},4,[267,347,349],{"emptyLinePlaceholder":348},true,"\n",[267,351,353],{"class":269,"line":352},5,[267,354,355],{"class":273},"# 2. The new images.\n",[267,357,359,361,363],{"class":269,"line":358},6,[267,360,281],{"class":280},[267,362,285],{"class":284},[267,364,365],{"class":284}," pull\n",[267,367,369],{"class":269,"line":368},7,[267,370,349],{"emptyLinePlaceholder":348},[267,372,374],{"class":269,"line":373},8,[267,375,376],{"class":273},"# 3. Start them.\n",[267,378,380,382,384,387],{"class":269,"line":379},9,[267,381,281],{"class":280},[267,383,285],{"class":284},[267,385,386],{"class":284}," up",[267,388,389],{"class":291}," -d\n",[241,391,392,393,395,396,399,400,403],{},"On start, the ",[245,394,247],{}," applies any database changes the new version brings, then exits, and everything else starts once it's done. Open pages show ",[245,397,398],{},"A new version of Hubstruct is ready"," with ",[245,401,402],{},"Reload",", so you can switch when it suits you.",[241,405,406],{},"Check that everything came back:",[257,408,410],{"className":259,"code":409,"language":261,"meta":262,"style":262},"docker compose ps\ndocker compose logs migrator\n",[264,411,412,421],{"__ignoreMap":262},[267,413,414,416,418],{"class":269,"line":270},[267,415,281],{"class":280},[267,417,285],{"class":284},[267,419,420],{"class":284}," ps\n",[267,422,423,425,427,430],{"class":269,"line":277},[267,424,281],{"class":280},[267,426,285],{"class":284},[267,428,429],{"class":284}," logs",[267,431,432],{"class":284}," migrator\n",[250,434,436],{"id":435},"what-the-migrator-does","What the migrator does",[241,438,439],{},"The migrator keeps a record of the database changes (migrations) it has applied. On every start it applies, in order, the ones not yet recorded, then exits with success. If one fails, it exits with an error, and nothing that uses the database starts, so Hubstruct never runs against a half-changed database.",[241,441,442],{},"Most updates have no migration, and the migrator finishes in a second. Some change large tables and take a few minutes; the release notes say so.",[250,444,446],{"id":445},"pinning-a-version","Pinning a version",[241,448,449,450,453,454,457],{},"The Compose file uses the ",[264,451,452],{},"latest"," images by default. To update only when you decide, pin a version in ",[264,455,456],{},".env",":",[257,459,463],{"className":460,"code":461,"filename":456,"language":462,"meta":262,"style":262},"language-ini shiki shiki-themes github-dark github-light","HUBSTRUCT_VERSION=1.4.2\n","ini",[264,464,465],{"__ignoreMap":262},[267,466,467,470],{"class":269,"line":270},[267,468,469],{"class":322},"HUBSTRUCT_VERSION",[267,471,472],{"class":329},"=1.4.2\n",[241,474,475],{},"and change it when you want to move.",[250,477,479],{"id":478},"going-back","Going back",[241,481,482],{},"If an update goes wrong:",[484,485,486,493,501],"ol",{},[487,488,489,490,492],"li",{},"Set ",[264,491,469],{}," back to the version you had.",[487,494,495,496,500],{},"Restore the dump you took before updating, as in ",[497,498,168],"a",{"href":499},"\u002Fdocs\u002Fself-hosting\u002Fbackups#restoring",". An older version can't use a database a newer one has changed.",[487,502,503,506],{},[264,504,505],{},"docker compose up -d",".",[250,508,510],{"id":509},"updating-the-models","Updating the models",[241,512,513],{},"The models update separately:",[515,516,517],"ul",{},[487,518,519,522,523,526],{},[245,520,521],{},"The models"," are pinned in the ",[264,524,525],{},"models"," image, and update with Hubstruct: a release that changes one downloads it on its first start.",[241,528,529],{},"A new model writes differently from the old one, but Hubstruct doesn't redo existing descriptions or tags by itself. Retry a step on the media you want redone.",[531,532,533],"style",{},"html pre.shiki code .si27w, html code.shiki .si27w{--shiki-default:#6A737D;--shiki-light:#6A737D}html pre.shiki code .sqoU-, html code.shiki .sqoU-{--shiki-default:#B392F0;--shiki-light:#6F42C1}html pre.shiki code .skb7c, html code.shiki .skb7c{--shiki-default:#9ECBFF;--shiki-light:#032F62}html pre.shiki code .sTU5a, html code.shiki .sTU5a{--shiki-default:#79B8FF;--shiki-light:#005CC5}html pre.shiki code .spKkM, html code.shiki .spKkM{--shiki-default:#F97583;--shiki-light:#D73A49}html pre.shiki code .shWlK, html code.shiki .shWlK{--shiki-default:#E1E4E8;--shiki-light:#24292E}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 .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);}",{"title":262,"searchDepth":301,"depth":301,"links":535},[536,537,538,539,540],{"id":252,"depth":277,"text":172},{"id":435,"depth":277,"text":436},{"id":445,"depth":277,"text":446},{"id":478,"depth":277,"text":479},{"id":509,"depth":277,"text":510},"Getting a new version, what happens to the database when you do, and going back if you need to.","md",{},{"title":172,"description":541},"S3_osJbZpNwargPesOjFc4RtammFzf-49s_9oDZDznI",[547,549],{"title":168,"path":169,"stem":170,"description":548,"children":-1},"What to back up, how to dump the database and copy storage safely, how to restore, and a script to run nightly.",{"title":176,"path":177,"stem":178,"description":550,"children":-1},"Splitting the worker across containers with worker roles, CPU limits, and what to tune for large libraries.",1795744073007]