[{"data":1,"prerenderedAt":487},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2020\u002F02\u002F22\u002Fbackup-and-restore-of-unifi-cloud-key-gen2-plus\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,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,68,70,71,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,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":5,"date":471,"description":213,"embedImage":472,"extension":473,"image":472,"intro":474,"meta":475,"navigation":446,"path":476,"seo":477,"series":472,"sitemap":478,"stem":479,"tags":480,"__hash__":486},"content\u002F2020\u002F02\u002F22\u002Fbackup-and-restore-of-unifi-cloud-key-gen2-plus.md","Backup and restore of Unifi Cloud Key Gen2 Plus",{"type":208,"value":209,"toc":464},"minimark",[210,214,217,220,225,228,234,239,251,254,257,260,322,325,329,332,335,354,358,361,367,378,381,391,394,417,420,423,460],[211,212,213],"p",{},"My unifi controller and unifi protect software are running on a Cloud Key Gen2 Plus device.",[211,215,216],{},"Today I noticed that it had gone into a fail state - it couldn't see that either were online. Checking them directly - the same - not responding.",[211,218,219],{},"So - a reboot - and - hmm - same issue. So it was time to go for a factory reset and restore.",[221,222,224],"h2",{"id":223},"restoring-the-controller","Restoring the controller",[211,226,227],{},"After the factory reset I headed to the controller setup first. I uploaded my backup and got",[229,230,231],"blockquote",{},[211,232,233],{},"The backup file you are trying to load is from a newer\nversion of the UniFi Controller and cannot be used with\nthis controller.",[235,236,238],"h3",{"id":237},"updating-the-controller-version-via-ssh","Updating the controller version via SSH",[211,240,241,242],{},"First - head to ",[243,244,245],"a",{"href":245,"rel":246,"target":250},"https:\u002F\u002Fwww.ui.com\u002Fdownload\u002Funifi\u002F",[247,248,249],"nofollow","noopener","noreferer","_blank",[211,252,253],{},"Get the URL of the latest version of UniFi Network Controller X.X.X for Debian\u002FUbuntu Linux and UniFi Cloud Key",[211,255,256],{},"Now we need to download and install this file.",[211,258,259],{},"SSH password: whatever you set up after the reset.",[261,262,267],"pre",{"className":263,"code":264,"language":265,"meta":266,"style":266},"language-shell shiki shiki-themes github-dark","ssh ubnt@CLOUD_KEY_IP\ncd \u002Ftmp\nwget URL\ndpkg -i DOWNLOADED.DEB\nrm DOWNLOADED.DEB\n","shell","",[268,269,270,283,293,302,314],"code",{"__ignoreMap":266},[271,272,275,279],"span",{"class":273,"line":274},"line",1,[271,276,278],{"class":277},"svObZ","ssh",[271,280,282],{"class":281},"sU2Wk"," ubnt@CLOUD_KEY_IP\n",[271,284,286,290],{"class":273,"line":285},2,[271,287,289],{"class":288},"sDLfK","cd",[271,291,292],{"class":281}," \u002Ftmp\n",[271,294,296,299],{"class":273,"line":295},3,[271,297,298],{"class":277},"wget",[271,300,301],{"class":281}," URL\n",[271,303,305,308,311],{"class":273,"line":304},4,[271,306,307],{"class":277},"dpkg",[271,309,310],{"class":288}," -i",[271,312,313],{"class":281}," DOWNLOADED.DEB\n",[271,315,317,320],{"class":273,"line":316},5,[271,318,319],{"class":277},"rm",[271,321,313],{"class":281},[211,323,324],{},"At this point you should be able to restore via the setup GUI. My restores are quite large and it can take some time.",[221,326,328],{"id":327},"restoring-protect","Restoring protect",[211,330,331],{},"There doesn't seem to be a similar way to update protect when the same issue happens - a backup from a newer version.",[211,333,334],{},"The simplest fix for this was:",[336,337,338,342,345,348,351],"ul",{},[339,340,341],"li",{},"Setup a new NVR with the same name as the old one",[339,343,344],{},"Give it a new user",[339,346,347],{},"Start it and login",[339,349,350],{},"Apply any waiting updates",[339,352,353],{},"Restore the backup (via import a backup file)",[221,355,357],{"id":356},"backups","Backups",[211,359,360],{},"So - this all means that I have to have backups already right? Yes.",[211,362,363,364],{},"Backups for the unifi controller will be on the external hard disk on the gen2+ at ",[268,365,366],{},"\u002Fsrv\u002Funifi\u002Fdata\u002Fbackup\u002Fautobackup\u002F",[211,368,369,370,374,375],{},"Backups for protec will be on the ",[371,372,373],"em",{},"internal"," disk at ",[268,376,377],{},"\u002Fetc\u002Funifi-protect\u002Fbackups",[211,379,380],{},"I had set up daily backups for the controller and protect.",[211,382,383,384,387,388],{},"I had then created a ",[268,385,386],{},"backup_to_nas"," shell script - ssh to the cloud key and place the script under ",[268,389,390],{},"\u002Fetc\u002Fcron.daily",[211,392,393],{},"This will use rsync - so we need rsync installed on the cloud key too:",[261,395,397],{"className":263,"code":396,"language":265,"meta":266,"style":266},"apt-get update\napt-get install rsync\n",[268,398,399,407],{"__ignoreMap":266},[271,400,401,404],{"class":273,"line":274},[271,402,403],{"class":277},"apt-get",[271,405,406],{"class":281}," update\n",[271,408,409,411,414],{"class":273,"line":285},[271,410,403],{"class":277},[271,412,413],{"class":281}," install",[271,415,416],{"class":281}," rsync\n",[211,418,419],{},"You'll need an ssh key on the cloud key and its public key needs to be on the nas.",[211,421,422],{},"Then the script itself is just two rsync calls",[261,424,426],{"className":263,"code":425,"language":265,"meta":266,"style":266},"rsync -qa \u002Fetc\u002Funifi-protect\u002Fbackups\u002F user@nas-host:\u002Fpath\u002Fto\u002Fbackup\u002FUnifi\u002Fprotect\u002F\n\nrsync -qa \u002Fsrv\u002Funifi\u002Fdata\u002Fbackup\u002Fautobackup\u002F user@nas-host:\u002Fpath\u002Fto\u002Fbackup\u002FUnifi\u002Funifi\u002F\n",[268,427,428,442,448],{"__ignoreMap":266},[271,429,430,433,436,439],{"class":273,"line":274},[271,431,432],{"class":277},"rsync",[271,434,435],{"class":288}," -qa",[271,437,438],{"class":281}," \u002Fetc\u002Funifi-protect\u002Fbackups\u002F",[271,440,441],{"class":281}," user@nas-host:\u002Fpath\u002Fto\u002Fbackup\u002FUnifi\u002Fprotect\u002F\n",[271,443,444],{"class":273,"line":285},[271,445,447],{"emptyLinePlaceholder":446},true,"\n",[271,449,450,452,454,457],{"class":273,"line":295},[271,451,432],{"class":277},[271,453,435],{"class":288},[271,455,456],{"class":281}," \u002Fsrv\u002Funifi\u002Fdata\u002Fbackup\u002Fautobackup\u002F",[271,458,459],{"class":281}," user@nas-host:\u002Fpath\u002Fto\u002Fbackup\u002FUnifi\u002Funifi\u002F\n",[461,462,463],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}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);}",{"title":266,"searchDepth":285,"depth":285,"links":465},[466,469,470],{"id":223,"depth":285,"text":224,"children":467},[468],{"id":237,"depth":295,"text":238},{"id":327,"depth":285,"text":328},{"id":356,"depth":285,"text":357},"2020-02-22 18:47 +0100",null,"md","After a cloudkey gen2 plus crash - how to get a backup restored when a factory reset installs an older software version.",{},"\u002F2020\u002F02\u002F22\u002Fbackup-and-restore-of-unifi-cloud-key-gen2-plus",{"title":206,"description":213},{"loc":476},"2020\u002F02\u002F22\u002Fbackup-and-restore-of-unifi-cloud-key-gen2-plus",[481,482,483,484,485],"unifi","unifi controller","unifi protect","unifi cloud key","tutorial","cw0zq4iYkTO9UrLoHqa7qLUrYjrVSjIIK5fwqxGMcwg",1775293007728]