# Restore a nest.

> renest restore brings a nest's files and dependencies back on another machine: it checks the machine first, checks every file against its recorded checksum, reinstalls the dependencies from the lock, then starts the app and runs the packed workflow once. When this machine can't run the nest, it says so before downloading.

Canonical page: https://renest.ai/docs/restore

<h2 id="two">A restore starts from a restore code or a manifest</h2>

<pre># a restore code — the usual way
$ cd /workspace 2&gt;/dev/null || cd ~
$ renest restore --grant grant.json --dir ./run

# a manifest whose files you can already reach
$ renest restore --manifest https://…/nests/&lt;nest-id&gt;/manifest.json --dir ./run</pre>

<p><code>--grant</code> takes the code as a file or as a URL. <code>--manifest</code> takes a
manifest file or URL; the files themselves have to be reachable from somewhere. A manifest
file read from a nest folder on this machine takes its files from the
<code>blobs/sha256/</code> folder beside it. Otherwise, a nest that lists no download sources
needs <code>--blob-base</code>: the URL its <code>blobs/sha256/</code> folder is served from,
or that folder's path on this machine. For anything on your drive or in a private
bucket, use a restore code.</p>

<h2 id="codes">Your drive issues restore codes; renest presign signs them for your own bucket</h2>

<p>A <strong>restore code</strong> lets a machine download one nest version without ever
seeing a storage key. There are two kinds, and they come from different places:</p>

<ul>
  <li><strong>From your Renest drive.</strong> In the web console, open the nest and choose
  <strong>Restore</strong>. You pick how long the code lasts — <em>1 day</em>,
  <em>3 days</em> or <em>7 days</em> — and the page gives you a command that writes it to
  <code>grant.json</code> and runs the restore. The code is not tied to a machine: if a pod
  breaks, paste it on another one. You can revoke it from the console at any time.</li>
  <li><strong>Signed by you, for your own bucket.</strong> If your nests live in an
  S3-compatible bucket you set up yourself, <code>renest presign</code> signs time-limited
  links on the computer that holds your bucket key. It needs that key configured (run
  <code>renest doctor --storage</code> for the steps); without one it stops with
  <em>No bucket of your own is set up yet</em>. The links cover what is in the bucket, so
  pack with <code>--dest s3</code> first. The code lasts 6 hours by default and 24 hours at
  most (<code>--expires-in</code>, in seconds); when it runs out, sign a new one.</li>
</ul>

<pre># own bucket only: on your own computer, where the key lives
$ renest presign --manifest ./nests/nests/&lt;nest-id&gt;/manifest.json --out code.json
# on the rented machine
$ renest restore --grant code.json --dir ./run</pre>

<p>Either way the rented machine gets the code, never the key. A machine you rented for an
hour should not be able to read your storage tomorrow.</p>

<h2 id="preflight">The pre-flight check runs first, and it can refuse</h2>

<p>Before pulling a single byte, Renest checks the machine against the nest: disk space,
driver, and — the one that actually bites — <strong>GPU architecture</strong>. Code compiled
for one generation of card does not run on a newer one it was never built for; you get
<code>no kernel image is available</code> at the worst possible moment, half an hour into a
paid rental.</p>

<p>So the check blocks that case up front. If you know better, <code>--force</code> goes ahead anyway.</p>

<p>It also looks for git, a C compiler, git-lfs and the system libraries the working run loaded. If any is missing and this account is root or can use sudo without a password, it asks <code>Install them now?</code> before anything downloads; <code>--yes</code> skips the question. Without those rights it prints the command instead. If an install it attempted fails, the restore stops there, and <code>--force</code> goes ahead anyway.</p>

<p>There is a second, cheaper question you can ask before renting anything:
<code>--check-only</code> lists every file this nest does <em>not</em> carry — with its size and the address the nest recorded for it — says which of them can be fetched from here, and stops without moving any bytes. It needs no GPU, so run it on your laptop.</p>

<p>The hardware check is available on its own too — see
<a href="/docs/quick-start#check">doctor</a>.</p>

<h2 id="resume">If it dies halfway, run the same command again</h2>

<p>Big models over a shared link means interruptions. Re-running the same restore picks up
where it left off: a file already on disk with the right size and matching bytes is kept, and everything else is fetched again. <code>--reverify</code> checks the kept files against their checksums once
more; <code>--no-resume</code> forces a clean start.</p>

<p>If a source is unreachable, the restore falls back to the next place that file can be
found and checks whatever it gets against the recorded checksum. A dead download link
doesn't end the restore.</p>

<h2 id="options">A few flags change what a restore does</h2>

<ul>
  <li><code>--package-source ADDRESS</code> — install dependencies from a package index
  closer to you when the default one is slow. Every package is still checked against the
  fingerprint recorded in the nest, and the address has to be one Renest recognises, or one
  you name with <code>--trust-host</code>.</li>
  <li><code>--yes</code> — install the git, C compiler, git-lfs or system libraries the nest needs without asking. Only works as root or with password-free sudo; otherwise the command is printed.</li>
  <li><code>--no-setup</code> — don't run the setup commands the nest brought with it. You
  get the files; the environment may be incomplete, and the report says which commands were
  skipped.</li>
  <li><code>--skip-launch</code> — restore the files and dependencies, then stop, without
  starting the app or running the packed workflow.</li>
  <li><code>--no-report</code> — with a code from your drive, the restore reports its
  progress back so the console's Restore page can show it: which stage it is in, how fast,
  how it ended, and facts about this machine (GPU, driver, free space). It never sends your
  file names or paths, the raw error text of other programs, or which host the files came
  from. If reporting fails it goes quiet and never affects the restore.
  <code>--no-report</code> turns it off.</li>
</ul>

<h2 id="verify">renest verify checks a restored folder again, at any time</h2>

<p>A restore checks files as it goes. To check again later — say, before trusting a restored
folder that's been sitting around:</p>

<pre>$ renest verify ./manifest.json --dir ./run
Verified (… files byte-checked)</pre>

<p><code>--check bytes</code> is the default and compares files. If any are missing or
wrong it says how many — <code>Byte check failed: … missing, … with the wrong bytes or
size</code> — and <code>--json</code> (or <code>--report</code> to a file) lists which ones. <code>--check image</code>
goes further and compares a newly rendered image against the one captured, for when you want
evidence that the environment is <em>alive</em>, not merely present — hand it the picture
with <code>--rendered</code>, or add <code>--render</code> and Renest will start the restored
app and produce it (it asks first, because that spends this machine's GPU time).
<code>--check both</code> does both.</p>

<h2 id="others">Nests someone handed to you</h2>

<p>Restoring another person's nest means running their custom nodes and setup steps on your
machine. Renest treats that as what it is:</p>

<p>Make a habit of reading first: <code>--plan</code> checks this machine, then lists what the
restore would download, whether the dependency list resolves, what the nest does not carry,
and <strong>every setup command it would run, in full</strong> — and stops before a single
byte is fetched. If the machine fails the check, <code>--plan</code> gives you that verdict
instead of a plan.</p>

<pre>$ cd /workspace 2&gt;/dev/null || cd ~
$ renest restore --grant grant.json --dir ./run --plan</pre>

<ul>
  <li>It lists <strong>every file that does not travel</strong> before anything downloads, in two groups: the ones it will fetch for you from their public original source and check against the nest, and the ones you need to provide, each with the exact path to put it at. If any cannot be had, it stops before the big download (exit 16) and names them all; put them in place and run the same command again. An address on a host Renest doesn't recognise is not contacted until you name the sender with <code>--trust-sender</code>.</li>
  <li>It shows you <strong>who sent it</strong> and stops before running any setup step from
  a stranger. <code>--trust-sender</code> is how you say you know them.</li>
  <li>It prints the setup commands <strong>before</strong> running them, including for nests
  you packed yourself.</li>
  <li>It only <em>installs dependencies</em> from well-known sources by default — that step
  runs code those servers hand you. An internal mirror is allowed with
  <code>--trust-host</code> — see
  <a href="/docs/dependency-sources">unrecognised dependency sources</a>. Model files
  travel a different path and are checked against their recorded checksum instead.</li>
</ul>

<h2 id="after">When it finishes, it tells you what to run next</h2>

<p>A restore that finishes prints <em>Done</em>, then <em>What's next</em>: where your
output lands, the command that starts the app, and <code>renest start --dir ./run</code>,
which runs it for you. <a href="/docs/after-restore">After the restore</a> covers
that part.</p>

<p>If it stops instead, the last lines name the stage and the reason.
<a href="/docs/troubleshooting">If a restore stops</a> goes through them one by one.</p>
