Restart from a backup
This page explains how to put back into BiblioViva the data of a backup: after the failure of the card or the disk, on another computer, after an error that deleted data. It is for whoever administers BiblioViva.
- Time: 20 to 40 minutes with another computer to prepare, about 10 minutes if BiblioViva already works.
- Requirements: a backup file (see below which ones) and the
adminaccount. - To restore on another computer: steps 1-4 of the installation, indicated further on.
Which file is needed
BiblioViva produces three kinds of file; each can be restored.
| File | Where it is | What it contains |
|---|---|---|
biblioviva-YYYYMMDD-HHMM.db | in the computer's backups folder, one per night | the library's data; the photos and the covers are in the backups/uploads folder |
biblioviva-export-YYYYMMDD-HHMM.zip | downloaded with Export everything | data, photos, covers and the whole configuration |
biblioviva-YYYYMMDD-HHMM.zip | in the backups folder, from the Create backup button | the parts chosen when the backup was made |
The configuration (settings, staff accounts, card and label templates) is part of the .zip files only. Restoring a
nightly .db backup, the configuration stays the one of the first run.
Procedure
If BiblioViva works: restore from the program
- Open BiblioViva with the
adminaccount, then Administration, then Backups. - For a file already in the list, press Restore… on its row.
- For a file brought from another computer, press Upload an archive and choose the file. The browser accepts files
up to 30 MB; a larger one is copied into the computer's
backupsfolder (next section) and then chosen from the list. - Read the check that BiblioViva shows: the parts the file contains (with a box each), how many rows there are now and how many in the file. Clear the tick of the parts not to be touched: they stay as they are.
- Press Restore. At the question "Restore the chosen parts?" confirm. The chosen data and configuration replace the current ones.
- Wait for the message "Restore completed".
Warning. The restore replaces the chosen data with those of the file. If the computer has recent data not to be lost, first press Back up now.
Copy a large file to the computer
-
From the computer where the file is, copy it into the
backupsfolder of the BiblioViva computer, replacing<user>with the username and<file>with the file name. The command works in the terminal of Windows, macOS and Linux; in place ofbiblioviva.localthe address used to connect to the computer can be used.scp <file> <user>@biblioviva.local:biblioviva/backups/ -
Open Administration, then Backups: the file appears in the list, and is restored with Restore….
If BiblioViva does not open: restore from the terminal
On the BiblioViva computer, with the terminal open as at the step Connect to the computer.
-
Copy the file into the
backupsfolder (withscpas above, or from a USB drive). -
Stop BiblioViva.
cd ~/biblioviva && docker compose stop app -
Have the restore program read the file, replacing
<file>with its name. The program checks the file and writes what it contains, without changing anything.docker compose run --rm --entrypoint bun app cli/backup-restore.js /backups/<file> -
If the check reports no errors, repeat the command with
--yesat the end: it really restores.docker compose run --rm --entrypoint bun app cli/backup-restore.js /backups/<file> --yes -
Restart BiblioViva.
docker compose start app
From the first run
On a newly installed computer, or when starting again from scratch, the guided procedure can restore an Export everything archive without answering its questions. The choice appears only until the guided procedure is completed.
- Open the BiblioViva address printed by
setup.sh: the First-time setup page opens. - In the first step, under the choice of language, press Restore from a backup.
- Press Choose the archive and choose the file
biblioviva-export-YYYYMMDD-HHMM.zip. The browser accepts files up to 30 MB. - Wait for the check. BiblioViva shows the library that made the archive, the date, the version, how many patrons, books and loans it contains and the accounts that will be able to log in.
- Press Restore. Settings, data and pictures come back as they were in the archive, all at once.
- Wait for the "Restore completed" screen, which lists the accounts of the archive.
- Press Go to the login and log in with one of those accounts, with the password it had in the archive.
An incomplete archive, one from a newer version or one that is not BiblioViva's is refused before anything is changed, with a message that explains why. For an archive larger than 30 MB complete the guided procedure and restore from the terminal, as described above.
On another computer
- Prepare the computer and install BiblioViva with steps 1-4 of the chosen path (see Installation), with the same way of connecting as before.
- At the step First run restore the file from the first screen of the guided procedure, as described in the section From the first run; the rest of the guided procedure is not needed.
- If the backup comes from a different computer, open Administration, Configuration, Performance and check the Computer field: the backup brings that of the old computer.
Result
BiblioViva shows again the patrons, books, loans and photos of the file. The staff accounts and their passwords are those of the backup, if it contained the configuration; otherwise they are those chosen at the first run.
Possible problems
- "The file is not a BiblioViva archive.": the chosen file is not a file produced by BiblioViva. Choose a
.dbor.zipfile from thebackupsfolder, or download the backup again. - "The backup is from another version of BiblioViva…": the file was made by a version that has different tables. Install the same version (see "Stay on a version" in Update BiblioViva), restore, then update.
- From the first run: "The archive is incomplete: … are missing": the file does not contain every part of a library (the settings, the accounts, the patrons or the catalogue). Choose an archive made with Export everything.
- From the first run: "The archive was made by a newer version of BiblioViva…": install that version first, restore, then update.
- The restore reports rows that "refer to … that would not be there": add to the choice the part that the message names and repeat.
- From the terminal: "permission denied" about Docker: see Install BiblioViva.