awx

← Blog

Walk-through · 17 November 2026

How to back up and restore a cloud computer: a tested guide

One backup file, saved somewhere that outlives the computer. Then delete things on purpose and bring them back, because a backup you have never restored is only a hope.

A computer keeps its files while it sleeps. That is not a backup. If you delete the computer, or a command removes the wrong folder, or you drop the wrong database, the files go with it. A backup is a copy kept somewhere else.

This post makes a backup of a small site, its database and a second database on a Small computer, saves it to Assets, then breaks the site and restores it. The restore found a mistake in the agent's own instructions, and that is the best argument for testing one.

Awi the cat agent holds a shield

What to back up

The first message

We used the computer from the XAMPP move post, which now had a MariaDB database for a club site and, from the SQL post, a PostgreSQL database called school. We sent:

I want a backup of everything on this computer that I would
miss if it were deleted. Please make one file,
/home/agent/backups/backup-YYYY-MM-DD.tar.gz, that holds: a dump
of the clubsite MariaDB database, a dump of the school PostgreSQL
database, the folder /home/agent/www, and
/home/agent/clubsite-move-notes.md. Put a README.txt inside that
says what is in it and how to restore each part. Do not delete or
change anything else. When it is done, list what is inside the
archive and its size, and tell me the one command to check the
archive is not damaged.

What the agent made

The agent looked first. MariaDB was running and PostgreSQL was stopped, since a restart leaves it off. It started PostgreSQL only to dump it, and stopped it again afterwards, so the computer was as it found it. It asked before the commands that wrote the dumps, and it checked the numbers inside them: 6 members, 15 students, 5 courses and 42 enrolments.

The agent's report: what it did, and the archive contents: clubsite_db.sql, school_db.sql, README.txt, clubsite-move-notes.md, and the www folder with index.php and db.php
One file of 7,349 bytes, with the two dumps, the site, the notes and a README.

It also gave the one command that checks the archive is readable, which you can run any time:

tar -tzf /home/agent/backups/backup-2026-11-16.tar.gz > /dev/null && echo OK

The agent raised two things we had not asked about. The site's db.php holds the real database password in plain text, so the archive is private: it set the file so only its owner can read it, and told us to keep it away from public links and public Git. And the dump does not contain the database login, so on a new computer you would make that user again and put the same password in db.php. The README says so.

Save it somewhere that survives

The archive is now on the computer's disk, which is the same place the originals are. Open the Files tab and go to the backups folder. Each file has Download, which saves it to your own laptop, and Save to assets.

The Files tab in the backups folder: backup-2026-11-16.tar.gz, 7.2 KiB, with Download and Save to assets
The Files tab. The archive is 7.2 KiB.

Assets is your own storage, apart from any computer. Its page says "Files that stay after a computer is deleted", and this account had 5 GiB of it. The dialog lets you name the copy, and a slash makes a folder:

The Save to assets dialog with the name backups/backup-2026-11-16.tar.gz
Name the copy backups/… to keep backups together.
The Assets page in the backups folder: backup-2026-11-16.tar.gz, 7.2 KiB, with Download and Delete, and 7.2 KiB of 20.0 GiB used
The backup in Assets, with a Download button of its own.

For a backup you really care about, also press Download once and keep that copy on your laptop or your university drive. Two places are safer than one.

Break it, then restore it

Then we tested it. We asked the agent to drop the database, move the site's folder out of the way (not delete it), show that the page was broken, and restore both from the archive by following its own README:

Now prove the backup works. Pretend the computer lost the club
site: drop the clubsite database and move /home/agent/www/clubsite
to /tmp/clubsite-old (do not delete it yet), then show me that
the page is broken. After that, restore both from the backup
following the README, and show me the page working again with 6
members. Tell me each command you ran, and any step where the
README was wrong or incomplete.

Before it did anything destructive, the agent made a safety copy of its own, in case the backup turned out to be bad, and then asked for approval. We had not told it to do either.

The agent's safety copy commands, then an approval request: drop the clubsite database and move the folder, with a safety copy already made, with Approve and Decline
A safety copy first, then the question. Read it before you press Approve.

We approved. The page went to a 404 with no members. The agent unpacked the archive, loaded the database dump with sudo mariadb < clubsite_db.sql, and copied the site back. After the fix described below, the page answered 200 with all six members, and diff -r said the restored folder was identical to the one it had moved aside.

What the restore found

The README the agent wrote had a mistake, and only the restore showed it. The restore command put the site in /home/agent/www/www, so the page stayed a 404. When the destination folder already exists, cp -a copies the folder into it. Adding /. copies its contents instead:

Wrong:   cp -a /tmp/restore-2026-11-16/www /home/agent/www
Correct: cp -a /tmp/restore-2026-11-16/www/. /home/agent/www/

The agent listed five more gaps in the README, and what to add for each.

The agent's list of README problems: the wrong cp command and its correction, no check of the web page after restoring, and no warning about port 8000
Problems 1 to 3 of 6, in the agent's own words.

That last one matters. A restore you have not run is a guess, and half of this backup is still a guess.

A checklist

  1. Dump each database to a file. Do not copy a running database's files.
  2. Put the dumps, your project folder and a README in one archive, and check it with tar -tzf.
  3. Write into the README what the dump does not hold: users, passwords, packages and ports.
  4. Save a copy to Assets, and download one to your own machine.
  5. Test the restore on purpose, with a safety copy first, and follow the README word for word.
  6. Fix the README where it was wrong, and repeat the backup when your data changes.

What it cost

It was a Small computer, RM0.03 an hour while it runs and nothing while it sleeps, for about half an hour, so a few sen. The archive was 7.2 KiB, and Assets is separate storage: this account had 5 GiB of it. How running time and credit work has the details, and why a computer sleeps says what stays on its disk.

Cautions

Keep reading

Getting started

Sign in with your Google account and open a chat on the computer you want to protect. Paste the first message from this post, then run the restore test the same day.

Open the workbench

Awi the cat agent celebrates with confetti

Awi, signing off.

← All posts