diff --git a/docs/deployment.md b/docs/deployment.md
index a880eef..7770125 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -1390,7 +1390,7 @@ an archive containing several sites. The archive identifies each website
by domain and site ID. Upgrade the panel and its web and backup workers
together before enabling additional sites.
-## Enable WordPress installation and administrator setup
+## Enable WordPress management
Install the verified [WP-CLI Phar](https://make.wordpress.org/cli/handbook/guides/installing/#verifying-the-download-optional-but-recommended)
as a root-owned regular file at `/usr/local/bin/wp` on the web node.
@@ -1417,6 +1417,30 @@ configuration. If the panel reports an email failure, correct the
site's outbound mail and use the WordPress password reset page. The
setup workflow keeps passwords out of panel jobs, logs and email.
+### Update WordPress, plugins and themes
+
+Use WP-CLI 2.10 or later for fresh core update checks. Open the site's
+**WordPress** page, select **Check for updates**, and review the installed
+and available versions. Select **Back up and update** for one component
+at a time. The panel offers stable releases from WordPress.org. Use
+WordPress to manage extensions from other sources.
+
+Updates require HTTPS, a single-site installation with its configuration
+in the site's document root, and a local MariaDB database managed by
+the hosting account. Enable local account backups and the website and
+database restore services. Coulobre creates a recovery archive with the
+selected document root and the entire database before applying the
+update, and checks that the advertised version is still available.
+Use a dedicated database for each WordPress site so that restoring its
+database does not replace tables for another application.
+
+If an update fails after it starts, use the matching archive in
+**Backup & Restore** to recover the document root and database as needed.
+Customers can restore their own update backups. Update backups do not
+replace the customer's latest SFTP export. Managers can ask the server
+operator to restore a backup they requested. Schedule updates during a
+quiet period because WordPress may briefly display a maintenance page.
+
## Enable the website file manager
The installer enables the file manager, scheduled website jobs and local
diff --git a/src/coulobre/hosting/backup_restores.py b/src/coulobre/hosting/backup_restores.py
index fdc1b6c..b5e7b0a 100644
--- a/src/coulobre/hosting/backup_restores.py
+++ b/src/coulobre/hosting/backup_restores.py
@@ -80,6 +80,15 @@ def available_website_restore_targets(backup, current=None):
}
+def require_no_wordpress_update(account):
+ if account.wordpress_jobs.filter(
+ action="update", finished_at__isnull=True
+ ).exists():
+ raise ValidationError(
+ "Wait for the current WordPress update to finish."
+ )
+
+
@transaction.atomic
def queue_website_restore(
backup,
@@ -93,6 +102,7 @@ def queue_website_restore(
):
account = lock_hosting_account(backup.account_id, customer_id=customer_id)
require_active_services(account)
+ require_no_wordpress_update(account)
backup.refresh_from_db()
if customer_id is not None and backup.export_customer_id != customer_id:
raise ValidationError("This backup is no longer available.")
@@ -130,6 +140,8 @@ def queue_component_restore(
):
account = lock_hosting_account(backup.account_id, customer_id=customer_id)
require_active_services(account)
+ if kind == RestoreKind.DATABASE:
+ require_no_wordpress_update(account)
backup.refresh_from_db()
if customer_id is not None and backup.export_customer_id != customer_id:
raise ValidationError("This backup is no longer available.")
diff --git a/src/coulobre/hosting/customer_backup_views.py b/src/coulobre/hosting/customer_backup_views.py
index bcd0e0c..87aeecd 100644
--- a/src/coulobre/hosting/customer_backup_views.py
+++ b/src/coulobre/hosting/customer_backup_views.py
@@ -70,7 +70,7 @@ class CustomerBackupView(UserPassesTestMixin, FormView):
export_customer_id=self.account.customer_id,
export_database_suffix="",
)
- .select_related("expiration")
+ .select_related("expiration", "wordpress_update")
.order_by("-requested_at")[:30]
)
kinds = enabled_component_restores()
diff --git a/src/coulobre/hosting/migrations/0089_wordpress_update_recovery.py b/src/coulobre/hosting/migrations/0089_wordpress_update_recovery.py
new file mode 100644
index 0000000..b001ce4
--- /dev/null
+++ b/src/coulobre/hosting/migrations/0089_wordpress_update_recovery.py
@@ -0,0 +1,23 @@
+# Generated by Django 5.2.19 on 2026-12-02 00:18
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("hosting", "0088_wordpress_operation"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="wordpressjob",
+ name="backup",
+ field=models.OneToOneField(
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="wordpress_update",
+ to="hosting.accountbackupjob",
+ ),
+ ),
+ ]
diff --git a/src/coulobre/hosting/models.py b/src/coulobre/hosting/models.py
index 3dbc4e8..ec32434 100644
--- a/src/coulobre/hosting/models.py
+++ b/src/coulobre/hosting/models.py
@@ -1385,6 +1385,12 @@ class WordPressJob(ProvisioningJob):
database = models.ForeignKey(
HostingDatabase, on_delete=models.SET_NULL, null=True
)
+ backup = models.OneToOneField(
+ "AccountBackupJob",
+ on_delete=models.SET_NULL,
+ null=True,
+ related_name="wordpress_update",
+ )
details = models.JSONField(default=dict)
report = models.JSONField(default=dict)
@@ -1427,7 +1433,10 @@ class AccountBackupJob(ProvisioningJob):
def can_restore_website(self, site):
return self.archive_is_restorable and (
- self.manifest.get("website") == site.manifest()
+ (
+ self.manifest.get("include_website", True)
+ and self.manifest.get("website") == site.manifest()
+ )
or site.manifest() in self.manifest.get("additional_websites", [])
)
diff --git a/src/coulobre/hosting/tasks.py b/src/coulobre/hosting/tasks.py
index 4b10a69..2fafab9 100644
--- a/src/coulobre/hosting/tasks.py
+++ b/src/coulobre/hosting/tasks.py
@@ -192,8 +192,14 @@ def dispatch_web_activations():
WordPressJob,
run_wordpress_job,
WEB_ACTIVATION_QUEUE,
- condition=Q(database__isnull=True)
- | Q(database__provisioning__finished_at__isnull=False),
+ condition=(
+ Q(database__isnull=True)
+ | Q(database__provisioning__finished_at__isnull=False)
+ )
+ & (
+ Q(backup__isnull=True)
+ | Q(backup__finished_at__isnull=False)
+ ),
)
dispatch_provisioning_jobs(
WebsiteRedirectPolicy,
@@ -956,7 +962,10 @@ def create_backup_job_archive(job):
job.backup_id,
backup,
remote_mail=job.remote_mail,
- publish_to_customer=job.export_customer_id is not None,
+ publish_to_customer=(
+ job.export_customer_id is not None
+ and not hasattr(job, "wordpress_update")
+ ),
database_suffix=job.export_database_suffix,
)
)
@@ -1155,7 +1164,7 @@ def run_wordpress_job(job_id):
if settings.WORDPRESS_MANAGEMENT and settings.LOCAL_WEB_ACTIVATION:
run_provisioning_job(
WordPressJob.objects.select_related(
- "account", "actor", "database"
+ "account", "actor", "database", "backup", "backup__expiration"
),
job_id,
run_wordpress_operation,
diff --git a/src/coulobre/hosting/templates/hosting/account_wordpress.html b/src/coulobre/hosting/templates/hosting/account_wordpress.html
index e122c58..cc66151 100644
--- a/src/coulobre/hosting/templates/hosting/account_wordpress.html
+++ b/src/coulobre/hosting/templates/hosting/account_wordpress.html
@@ -41,18 +41,69 @@
+ {% if version %}
+ WordPress.org updates
+
+
Ask your server operator to enable website and database recovery before updating.
+ {% elif not updates_has_database %} +Panel updates require a local database managed by this hosting account.
+ {% endif %} +| Component | Installed | Available | Actions |
|---|---|---|---|
| {% if update.kind == "core" %}WordPress core{% else %}{{ update.slug }} · {{ update.kind }}{% endif %} | +{{ update.installed }} | +{{ update.version }} | ++ {% if updates_can_recover and updates_has_database %} + + {% else %}—{% endif %} + | +
No available WordPress.org updates were reported.
+ {% endif %} + {% endif %} {% if jobs %} +| Operation | Requested | Result | |
|---|---|---|---|
| {% if job.action == "add-admin" %}Add administrator{% elif job.action == "install" %}Install{% else %}Detect{% endif %} | +{% if job.action == "add-admin" %}Add administrator{% elif job.action == "install" %}Install{% elif job.action == "check-updates" %}Check for updates{% elif job.action == "update" %}Update {{ job.details.update.slug }} to {{ job.details.update.version }}{% else %}Detect{% endif %} | {{ job.requested_at }} |
{% if job.problem %}{{ job.problem }}
{% else %}{{ job.state|capfirst }}{% endif %}
+ {% if job.backup %}
+ Recovery backup requested {{ job.backup.requested_at }} · {{ job.backup.state|capfirst }}. + {% if recovery_route %}Backup & Restore{% else %}Contact your server operator to restore it.{% endif %} + {% endif %} {% if job.report.password_email == "accepted" %} WordPress accepted the password setup email. {% elif job.report.password_email == "failed" %} WordPress could not send the setup email. Check the website's mail settings and request a password reset. {% endif %} diff --git a/src/coulobre/hosting/templates/hosting/customer_backups.html b/src/coulobre/hosting/templates/hosting/customer_backups.html index 604e0e9..974dd08 100644 --- a/src/coulobre/hosting/templates/hosting/customer_backups.html +++ b/src/coulobre/hosting/templates/hosting/customer_backups.html @@ -12,7 +12,7 @@ Recent backups
|