Add native website backups and single-file restore #23

Merged
parkel merged 2 commits from feature/native-website-backups into main 2026-11-21 11:40:40 +01:00
2 changed files with 49 additions and 0 deletions
Showing only changes of commit 2306656012 - Show all commits

No files matched your search

+7
View File
@@ -312,6 +312,13 @@ SFTP sessions before transferring the hosting account to another customer.
Connect to the web node's SSH hostname and port, which may differ from
the hostname that a reverse proxy uses for web traffic.
## Back up hosted website files
Use the web node commands to archive a website's document root and
restore the entire tree or a selected file. The archive stays on the
web node at the path supplied by the operator.
[Website backup and restore](development.md#back-up-and-restore-hosted-website-files)
## Provision local databases from the panel
Enable the [database provisioning socket](development.md#enable-local-database-provisioning)
+42
View File
@@ -777,6 +777,48 @@ sudo /opt/coulobre/bin/coulobre-web-node set-sftp-keys \
sftp coulobre-1@web-node.example.org
```
## Back up and restore hosted website files
Apply the site's deployment manifest on the web node. Use that manifest
to create a native website backup in a root-controlled directory.
```sh
sudo install -d -m 0700 /var/backups/coulobre
sudo /opt/coulobre/bin/coulobre-web-node backup-site \
coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz
```
The root-only archive contains the account and domain identity plus
directories and regular files from the document root. The backup report
counts symbolic links and other non-regular entries as skipped.
Use a new archive filename for each backup. Pause SFTP uploads and
application writes for a consistent copy. The backup detects changes
while reading entries and requires site-owned files with Unix mode
permissions on the document root's filesystem.
To recover one file, select its path relative to the document root.
Its parent directory must already exist. To overwrite an existing
site-owned file at that path, add `--replace`.
```sh
sudo /opt/coulobre/bin/coulobre-web-node restore-site \
coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz \
--file assets/site.css --replace
```
To restore the entire archive, run the command with an empty document
root for the same account and domain.
```sh
sudo /opt/coulobre/bin/coulobre-web-node restore-site \
coulobre-web-plan-1.json /var/backups/coulobre/site.tar.gz
```
Use a root-owned archive with mode `0600`. The node validates the
entire archive before publishing restored files. Restored files belong
to the site account, with the Apache read access recorded in the
backup. The website can be recovered while its web services are stopped.
## Run an isolated PHP test site
Open a completed preview for the account's current domain and select **Download