Backups and Keeping It
By the end of this chapter you know exactly which file to copy to back up a default installation — because the lab opened that file and read the inventory — and what the answer becomes when the installation grows up.
One file, proved
With the default setup, everything
NocoDB knows is in noco.db, the
SQLite file in the tool directory. The
lab's file after a day's work was 2.5
MB, and opening it with a plain SQLite
reader showed 113 tables in three
families (transcript t11):
- The metadata — about a hundred tables of bookkeeping: users, bases, table and field definitions, views, members and roles, API tokens, webhook and automation definitions.
- The sample base's data — the Getting Started base's Features table, a real table in the same file.
- Your data — the lab's Items
and Locations tables, ordinary
SQLite tables, whose row count a
plain
SELECT COUNT(*)confirmed as 8.
So a backup of a default installation
is: stop the server, copy noco.db,
restart. (Copying a live SQLite file
can catch it mid-write; the stop is
what makes the copy trustworthy, or
use SQLite's own online backup through
the sqlite3 tool.) Restoring is the
reverse: put the file back where
NC_TOOL_DIR points, start the server,
sign in. Two qualifications, both
structural rather than scary: if any
table uses attachment fields, the
uploaded files live as files under the
tool directory too — copy the whole
directory, not just the database (the
lab used no attachments, so its
directory held the one file). And if
you set NC_DB to keep the metadata in
PostgreSQL or MySQL, the backup
question moves to that database's own
well-documented answer — dump the
metadata database with its tools, and
copy the tool directory alongside for
attachments.
For a base built on an external database (chapter 11), the split from that chapter applies in full: back up your database for the rows, and the metadata for everything NocoDB layered over them. Either half alone restores half a base.
Keeping it
Three habits, in order of how often their absence is regretted.
Update deliberately. The server is
one file or one container, so updating
is replacing it — but chapter 3's
finding stands as the warning: the
project's current release line and the
line its binary ships on are not the
same at the moment, and a jump across
major versions deserves a copy of
noco.db taken first and kept. Read
the release notes for the version you
are moving to; NocoDB migrates its
metadata itself on first start, and a
backup is what makes that sentence
relaxing instead of alarming.
Keep the first account's password like a root password, because it is one (chapter 4). Watch who and what can reach the port: the server ships with an open sign-up form and the ability to share views publicly, both reasonable on a home network and both worth a thought before the port faces the internet — a reverse proxy with real authentication in front of it is the usual answer, and the guides in this series on Caddy and Traefik cover that machinery.
Prune the doors you opened. API tokens whose scripts retired, share links whose event passed, members who left. Chapter 10 made the principle; this is its calendar reminder.