Maintaining regular backups of your WordPress website is essential to safeguard against data loss, hacking, or server issues. Automating this process ensures your backups are consistent and hands-free. This guide walks you through setting up an automated WordPress backup using n8n, an open-source workflow automation tool, and Dropbox for storage.

Prerequisites

  • A WordPress website with admin access
  • An n8n account or self-hosted n8n instance
  • A Dropbox account with sufficient storage
  • Basic knowledge of n8n and WordPress

Step 1: Prepare Dropbox

Log in to your Dropbox account. Create a dedicated folder named WordPress Backups to store your backups. Generate an access token for API access:

  • Go to Dropbox App Console
  • Create a new app with the Scoped access type and select Full dropbox access
  • Name your app and click Create App
  • In the app settings, generate an OAuth 2 access token

Step 2: Set Up n8n Workflow

Log in to your n8n instance. Click on New Workflow to start creating your automation process.

Step 2.1: Add WordPress Backup Trigger

Choose a trigger node, such as Schedule, to run the backup at your desired interval (daily, weekly, etc.).

Step 2.2: Add WordPress Export Node

Use the HTTP Request node to call the WordPress REST API for exporting your database and files. Configure it as follows:

  • Method: GET
  • URL: https://yourdomain.com/wp-json/wp/v2/export (or your custom export endpoint)
  • Authentication: Use your WordPress admin credentials or a REST API key

Step 2.3: Compress Backup Files

Add a Function node to compress the exported files into a ZIP archive for easier storage and transfer.

Step 2.4: Upload to Dropbox

Use the Dropbox node to upload the ZIP file to your backup folder. Configure it with:

  • Operation: Upload
  • Path: /WordPress Backups/backup-YYYYMMDD.zip
  • Authentication: Enter your Dropbox access token

Step 3: Automate and Test

Save your workflow. Run a manual test to ensure the backup completes successfully and the file appears in Dropbox. Adjust scheduling as needed to automate the process.

Additional Tips

  • Encrypt your backups for added security
  • Set up notifications in n8n to alert you of backup status
  • Regularly check your Dropbox storage to prevent overflow

By following these steps, you can ensure your WordPress site is backed up automatically, saving time and reducing the risk of data loss.