{"id":206,"date":"2024-04-14T20:44:58","date_gmt":"2024-04-15T03:44:58","guid":{"rendered":"https:\/\/pronoiac.org\/misc\/?p=206"},"modified":"2024-04-14T20:46:59","modified_gmt":"2024-04-15T03:46:59","slug":"time-machine-migrating-from-a-network-share-to-an-external-drive","status":"publish","type":"post","link":"https:\/\/pronoiac.org\/misc\/2024\/04\/time-machine-migrating-from-a-network-share-to-an-external-drive\/","title":{"rendered":"Time Machine, migrating from a network share to an external drive"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">why?<\/h2>\n\n\n\n<p>I was restoring an entire computer, and restoring from my network share on a NAS wouldn\u2019t work: it would quietly hang, a day in. Copying the backups to an external drive and restoring from <em>that<\/em> worked.<\/p>\n\n\n\n<p>This is the simpler migration. I\u2019m planning to post the opposite direction separately.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">scary warnings (haha, but seriously)<\/h2>\n\n\n\n<p>I started writing these for the \u201cexternal drive to network share\u201d migration, but, uh.\nLook, doing this still feels a bit cavalier to me, I guess.<\/p>\n\n\n\n<p>These processes were largely worked out with HFS+ backups; I haven\u2019t walked through these with APFS backups.<\/p>\n\n\n\n<p>These (mostly) worked for me, but they are very much not officially supported.<\/p>\n\n\n\n<p>There\u2019s a lot of context, and I\u2019ve likely forgotten details; it&#8217;s been a year or two. This is still kind of a rough draft. I\u2019ll try to highlight rough bits and gaps.<\/p>\n\n\n\n<p>Newer versions of the OS might be more protective of letting you access these backups, even as root.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">caveats<\/h2>\n\n\n\n<p>I think the external drive won\u2019t be encrypted, even if the sparse bundle on the network share was. I <em>think<\/em> I managed to get it to start incrementally encrypting the external drive by adding it as a backup location, with encryption, then having it go \u201coh! ok! got it\u201d.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">background<\/h2>\n\n\n\n<p>On a network share, Macs use <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sparse_image#Sparse_bundle_disk_images\">sparse bundles<\/a> to make something that looks like a Mac disk image, on a network share where the file system is relatively unimportant.\nIf the Mac can read and write the files within, things like user IDs, permissions, and encryption don\u2019t have to be coordinated across machines.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mounting the source sparse bundle<\/h2>\n\n\n\n<p>On the network share, it will be called something like <code>Bob's MacBook.backupbundle<\/code> or <code>.sparsebundle<\/code>.\nFrom the Finder, you can \u201cConnect to the server\u201d, go to the network share, select the appropriate sparse bundle, and either double-click it or right-click and \u201cOpen\u201d it.\nYou\u2019ll probably see \u201cTime Machine Backups\u201d as a mounted volume.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">file layout for \u201cTime Machine Backups\u201d<\/h3>\n\n\n\n<p>Note, this is for an APFS backup.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Backups.backupdb<\/code>\n<ul class=\"wp-block-list\">\n<li>the name of the Mac, e.g. <code>Bob's MacBook<\/code>\n<ul class=\"wp-block-list\">\n<li>a series of directories with timestamps, like <code>2024-04-13-092828<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">preparing the target external drive<\/h2>\n\n\n\n<p>Erase and reformat the external drive.\nLabel it something distinctive, so you don\u2019t confuse source and target for the copy.\nMount it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">copy data<\/h2>\n\n\n\n<p>I\u2019d recommend ethernet instead of wifi.<\/p>\n\n\n\n<p>From a Mac, once the sparse bundle and the external drive are mounted:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># change these as appropriate\ninput=\"\/Volumes\/Time Machine Backups\" # sparse bundle\noutput=\"\/Volumes\/Time Machine 2023\" # external drive\n\ndate; time sudo asr \\\n  --source \"$input\" \\\n  --target \"$output\" \\\n  --erase; \\\n  date\n<\/code><\/pre>\n\n\n\n<p>It will prompt for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the sudo password<\/li>\n\n\n\n<li>confirmation of the erasure of the external drive<\/li>\n<\/ul>\n\n\n\n<p>Part of the process was unmounting the source.\nIf interrupted, I had to redo:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>remount the source<\/li>\n\n\n\n<li>erase and reformat the external drive<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">example output<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Validating target...done\nValidating source...done\nErase contents of \/dev\/disk5 ()? &#91;ny]: y\nValidating sizes...done\nRestoring  ....10....20....30....40....50....60....70....80....90....100\nVerifying  ....10....20....30....40....50....60....70....80....90....100\nRestored target device is \/dev\/disk5.\n<\/code><\/pre>\n\n\n\n<p>This took about 35 hours to process a 4TB drive, 2.6TB used.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>why? I was restoring an entire computer, and restoring from my network share on a NAS wouldn\u2019t work: it would quietly hang, a day in. Copying the backups to an external drive and restoring from that worked. This is the simpler migration. I\u2019m planning to post the opposite direction separately.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[19,18],"class_list":["post-206","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-macs","tag-time-machine"],"_links":{"self":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/206"}],"collection":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/comments?post=206"}],"version-history":[{"count":5,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/posts\/206\/revisions\/211"}],"wp:attachment":[{"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pronoiac.org\/misc\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}