Backing up Harblet
Harblet's own database holds your accounts, projects, services and their settings, environment variables, domains, certificates and the list of backups. Harblet backs it up like any other database, and you can restore it onto a fresh server.
Set up the backup
Choose a destination
Go to Settings → Backups. Choose a backup destination, a schedule and how many scheduled backups to keep, then click Save. Click Back up now to take the first backup right away.
Keep the app secret
On the same page, the App secret card shows the secret of this install, hidden. Click the eye button to show it, or the copy button to copy it, and keep it somewhere safe, for example in your password manager.
Harblet's backups are stored at <folder>/harblet-system/postgres/<time>.dump in the bucket. You can download and delete them under Settings → Backups. They can't be restored from there, because Harblet restores itself while it's installed on a new server.
Restore Harblet onto a new server
Restore Harblet when its first server is lost, or to move it to another server.
Prepare a fresh server
Set up a server that meets the requirements.
Copy the backup to the server
Take the newest file from the folder harblet-system/postgres at your destination, or download it under Settings → Backups while the old install still runs. Copy it to the new server as backup.dump.
Run the install script with the backup
On the new server, in the folder that holds backup.dump, download the install script and run it with your app secret:
curl -fsSL https://raw.githubusercontent.com/harblet/harblet/main/install.sh -o install.sh
sudo HARBLET_APP_SECRET=your-app-secret HARBLET_BACKUP=backup.dump sh install.sh
The Restore card under Settings → Backups has the second command ready to copy.
If the server is behind NAT, add HARBLET_URL as for a normal install.
When it's done, the script prints:
Harblet is ready with the restored backup. Open http://203.0.113.20:3000 and log in.
Log in
Open the address and log in with your existing account.
After the restore
The restore brings back Harblet's data, but nothing runs yet. Bring your services back in this order:
- Point your domains at the new server. Change the DNS A records of Harblet's domain and of your services' domains to the new server's IP address.
- Give Harblet its domain again under Settings → General. Harblet starts at
http://<ip>:3000after a restore. See Harblet's domain. - Deploy each database, then restore its newest backup from its Backups tab. Databases start empty on the new server.
- Deploy your other services. Git services build again.
- Add your other servers again, if you had any. See Servers. Uninstall k3s on them first with
sudo /usr/local/bin/k3s-agent-uninstall.sh.
Errors
| Message | What to do |
|---|---|
| backup.dump isn't a backup of Harblet's database. Set HARBLET_BACKUP to the .dump file from the backup destination. | Check that backup.dump is in the current folder and was copied completely, and that it comes from the harblet-system/postgres folder. |
| Restoring a backup needs the app secret of the install it comes from. Set HARBLET_APP_SECRET to it. | Add HARBLET_APP_SECRET to the command. |
| HARBLET_APP_SECRET isn't an app secret. An app secret has 64 characters, the digits 0 to 9 and the letters a to f. | Copy the app secret again, without spaces or line breaks. |