Skip to main content
Glama
sitebay
by sitebay

sitebay_backup_restore

Restore WordPress sites to previous backup points, configure database and file restoration, and simulate changes before applying them.

Instructions

Restore a site to a previous point in time.

Args (PITRestoreCreate schema): fqdn: The site domain restore_point: ISO datetime string (or omit for latest) for_stage_site: Whether to restore the stage site restore_db: Restore database (default true) restore_wp_content: Restore wp-content (default true) delete_extra_files: Delete extra files from target (default false) dolt_restore_hash: Optional Dolt hash to restore DB is_dry_run: Simulate restore without applying changes

Returns: Restore operation confirmation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fqdnYes
restore_pointNo
for_stage_siteNo
restore_dbNo
restore_wp_contentNo
delete_extra_filesNo
dolt_restore_hashNo
is_dry_runNo

Implementation Reference

  • Primary handler function for the 'sitebay_backup_restore' tool. Decorated with @mcp.tool for automatic registration in the MCP server. Implements the core logic: logs the action, initializes the SiteBay client, constructs restore parameters from inputs, calls client.create_restore(), and returns success/error messages.
    @mcp.tool
    async def sitebay_backup_restore(
        ctx: Context,
        fqdn: str,
        restore_point: Optional[str] = None,
        for_stage_site: Optional[bool] = None,
        restore_db: Optional[bool] = None,
        restore_wp_content: Optional[bool] = None,
        delete_extra_files: Optional[bool] = None,
        dolt_restore_hash: Optional[str] = None,
        is_dry_run: Optional[bool] = None,
    ) -> str:
        """
        Restore a site to a previous point in time.
        
        Args (PITRestoreCreate schema):
            fqdn: The site domain
            restore_point: ISO datetime string (or omit for latest)
            for_stage_site: Whether to restore the stage site
            restore_db: Restore database (default true)
            restore_wp_content: Restore wp-content (default true)
            delete_extra_files: Delete extra files from target (default false)
            dolt_restore_hash: Optional Dolt hash to restore DB
            is_dry_run: Simulate restore without applying changes
        
        Returns:
            Restore operation confirmation
        """
        try:
            await ctx.info(f"Starting point-in-time restore for {fqdn}")
            client = await initialize_client()
    
            restore_data: dict[str, Any] = {}
            if restore_point is not None:
                restore_data["restore_point"] = restore_point
            if for_stage_site is not None:
                restore_data["for_stage_site"] = for_stage_site
            if restore_db is not None:
                restore_data["restore_db"] = restore_db
            if restore_wp_content is not None:
                restore_data["restore_wp_content"] = restore_wp_content
            if delete_extra_files is not None:
                restore_data["delete_extra_files"] = delete_extra_files
            if dolt_restore_hash is not None:
                restore_data["dolt_restore_hash"] = dolt_restore_hash
            if is_dry_run is not None:
                restore_data["is_dry_run"] = is_dry_run
    
            result = await client.create_restore(fqdn, restore_data)
    
            await ctx.info(f"Successfully initiated restore for {fqdn}")
            return (
                "✅ **Point-in-Time Restore Initiated**\n\n"
                f"Restore operation for {fqdn} has been started."
            )
        except SiteBayError as e:
            await ctx.error(f"Error starting restore: {str(e)}")
            return f"❌ Restore Error: {str(e)}"
        except Exception as e:
            await ctx.error(f"Unexpected restore error: {str(e)}")
            return f"❌ Unexpected error: {str(e)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sitebay/sitebay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server