Update a site
Updating publishes a new version of a folder on an existing site, so its address and its names do not change. Only the files that changed are uploaded; the rest keep their place.
You need: a connected wallet that owns the site, and the folder with the new version.
1. Choose the site
Either:
- in My sites, press Update on the site. The app opens Publish a site with that site selected in Publish as; or
- in Publish a site, choose the site in Publish as. Your own sites are listed first; the ones sent by other accounts come in a group apart.
You can choose the site before or after choosing the folder. If Publish as stays on A new
site, the folder is published as a new site, even if its ws-resources.json has the object_id
of one of yours (the app shows a notice with a button to update that one instead).
2. Choose the folder
Drag or choose the folder with the new version, as when publishing. The app compares it with the published site, file by file, by content:
- files with the same content are unchanged and are not uploaded, even if they moved to a different quilt in your folder;
- files with new content, and new files, are to upload;
- files of the site that are not in the folder are removed.
The Site name is filled in with the site's current name, unless ws-resources.json sets one.
3. Review the changes
Before you sign, under Estimated cost the app says:
- N files to upload, M unchanged and the storage they cost;
- if some blobs of the site end before the date you chose, how much it costs to renew them until that date (to renew N blob(s) of the site until <date>). Updating always leaves the whole site paid until that date;
- Updating removes N file(s) of the site that are not in this folder, with their paths;
- N blob(s) (size) of your wallet that the site no longer uses will be deleted: the quilts that only held removed or changed files, which no other site of yours uses.
A file whose only change is its headers (from ws-resources.json) is not uploaded again: only its
entry in the site changes. Files whose blob expired or no longer belongs to you are uploaded again
and counted as such.
4. Update
Press Update site and approve the transactions in your wallet:
- the first registers and pays for the new quilts (if there is anything to upload);
- after the storage nodes confirm, the second certifies them, renews the blobs still in use, rewrites the site (resources, routes, redirects, name and metadata) and deletes the blobs it no longer uses.
With nothing to upload (the same files and more days, or only header changes), there is a single transaction. A very large change may need one or two more.
The steps show what happened to the old blobs: Deleted a blob the site no longer uses, or Kept a blob the site no longer uses: another of your sites uses it.
The result box says Site "…" updated, with the same address as before, until <date> (epoch N) and the cost.
Good to know
- Visitors see the new version once it has been reviewed. What changes is shown after its
review; until then, the changed files give a Pending review
page, and the rest of the site is served as before. Browsers that cached a page check it again on
the next visit (the portal tells them to), so a changed page is served fresh. Files that never change can
be cached longer with a header in
ws-resources.json. - Removed files. A path that disappears from the site answers 404 from then on; its deposit comes back to you.
- Deleted blobs free paid space. The space of a deleted quilt stays in your wallet and is used by the next quilts you publish, as with any deleted blob.
- Updating a site sent by another account works the same, except that none of your blobs is deleted. See Sites sent by other accounts.
- The command line does the same with
updateanddeploy, and can keep the old blobs with--keep-blobs. The full rules are in Update, renew and destroy.