How to Back up and Restore a WordPress Website Using MARS?


Last modified date: 2024-08-09

Overview

Backing up your WordPress website is likely a crucial component of your business's data protection strategy. However, the typical backup solution can often be complex, time consuming, and costly. And using the backup services of a typical WordPress hosting provider comes with its own risks such as data corruption, cyber-attacks, or sudden termination of business. QNAP's MARS (Multi-Application Recovery Service) is designed to help you overcome these obstacles by offering a permanent, safe, and simple backup solution. This tutorial will guide you through the process of backing up and restoring your WordPress website using MARS.

How to Backup a WordPress Website

To backup a WordPress website, perform the following steps:

  1. Create a WordPress service for the WordPress website:
    1. Install the QNAP NAS Backup plugin in WordPress.
      For details, see Installing QNAP NAS Backup in WordPress.
    2. Obtain the WordPress access key.
      For details, see Obtaining the WordPress Access Key.
    3. Create a WordPress service.
      For details, see Creating a WordPress Service.
  2. Create a backup job for the WordPress service.
    The backup job can be run manually or by schedule. For details, see Creating a Backup Job.

Installing QNAP NAS Backup in WordPress

The QNAP NAS Backup plugin for WordPress allows you to run WordPress backup and restore jobs in MARS, and also allows you to view MARS job records in WordPress.

  1. Log in to WordPress with an administrator account.
  2. Go to Plugins > Add New.
  3. Enter QNAP NAS Backup in the search bar.

    The QNAP NAS Backup should appear in the search results.

  4. Click Install Now.
  5. Click Activate.

The WordPress plugin QNAP NAS Backup is installed.

Obtaining the WordPress Access Key

MARS requires an access key from WordPress to create a WordPress service. The access key is generated by the QNAP NAS Backup plugin.

  1. Go to QNAP Backup.
  2. Next to Access key, click Copy.

The access key is copied to your clipboard.

Creating a WordPress Service

A WordPress service allows MARS to back up or restore an entire WordPress application (including all themes and plugins) or only the database used by a WordPress application.

  1. Open MARS.
  2. Go to Application > WordPress.
  3. Click Add Service.

    The Add Service window appears.

  4. Specify the following information:
    • Service name
    • Host URL
    • QNAP NAS Backup access key

  5. Click Verify.

    MARS verifies the target WordPress application is accessible using the QNAP NAS Backup access key.

  6. Click Apply.

    The WordPress service is created and appears in the service list.

Creating a Backup Job

  1. Go to Backup.
  2. Click Create backup job.

    The Create Backup Job window appears.

  3. Under Job information, specify the job information.

    Field

    Action

    Service type

    Select WordPress.

    Job name

    Specify the job name.

    The job name must be between 1 and 32 characters.

    Description (optional)

    Specify a description.

    The description can contain up to 100 characters.

  4. Under Source and Destination, specify the source application to back up.
    1. Under Source, click Browse.
    2. Select a service, and then click Select.
  5. Under Source and Destination, specify the backup destination folder.
    1. Under Destination, click Browse.
    2. Select a backup destination backup folder, and then click Select.
      Tip
      To create a new destination folder, click Add Folder.
  6. Under Back Up Component, specify the source application components to back up:

    Choose one of the following:

    • All (WordPress file and database)
    • WordPress file
    • Database
  7. Under Backup Schedule, specify a backup schedule:

    Schedule Type

    Description

    Manual

    Runs only when a user starts the job.

    Run once after

    Runs the job after a linked job finishes running.

    Warning
    If the linked job fails, the job will not run.
    1. Click Select a linked job.
    2. Choose a linked job.

    Run by schedule

    Runs the job on a repeating schedule.

    1. Choose one of the following and specify the relevant information:
      • One-time: Specify the date and time.
      • Daily: Specify the time.
      • Weekly: Specify the time and days of the week.
      • Monthly: Specify the time and the days of the month.
      • Periodic: Specify the date, time, and wait interval. A job with a periodic schedule runs on the date and time specified, then runs recurrently every wait interval. For example, if the wait interval is 2 hours then the job runs every two hours after its initial run.
    2. Optional: Select Set end time and specify a date and time for terminating the job schedule.
    3. Click Apply.

    A schedule is created and appears in the schedule list.

  8. Optional: Enable version management.
    1. Select Enable backup version retention policy for multiple backups.
    2. Under Retention Policychose one of the following:
      • Retained days: Every backup is saved to the destination folder for the specified number of days and then deleted afterwards.
      • Retained versions: Only a specified number of versions are saved to the destination folder. When the number is reached, the newest version replaces the oldest version.
    3. Under Threshold, specify a number corresponding to the number of days or versions retained.
  9. Click Apply or Back Up Now.

    The backup job is created.

    If you clicked Back Up Now, the backup job runs immediately.

How to Restore a WordPress Website

To restore a WordPress website, perform the following steps:

  1. Optional: Increase the file upload size limit.
    For details, see Increasing the File Upload Size Limit.
  2. Create a restore job.
    For details, see Creating a Restore Job.

Increasing the File Upload Size Limit

In order to successfully back up or restore large WordPress applications that contain many plugins, themes, or databases, you may need to increase the file upload size limit.

  1. Open a Secure Shell (SSH) connection to your QNAP NAS.
  2. Enter the following commands in the terminal depending on the type of WordPress application and the version of Container Station installed on your QNAP device:
    Warning
    To allow WordPress to process larger file transfers, the following commands also increase the PHP RAM usage limit and the PHP script execution time limit.
    A native WordPress application
    Container Station VersionCommands
    3.x
    cat <<EOF >> /proc/`system-docker inspect -f '{{.State.Pid}}' wordpress-wordpress-1`/root/var/www/html/WordPress/.htaccess
    php_value upload_max_filesize 1280M
    php_value post_max_size 1280M
    php_value memory_limit 2560M
    php_value max_execution_time 3000
    php_value max_input_time 3000
    EOF

    2.x
    cat <<EOF >> /proc/`system-docker inspect -f '{{.State.Pid}}' wordpress_wordpress_1`/root/var/www/html/WordPress/.htaccess
    php_value upload_max_filesize 1280M
    php_value post_max_size 1280M
    php_value memory_limit 2560M
    php_value max_execution_time 3000
    php_value max_input_time 3000
    EOF

    Your terminal will look like the following (Container Station v3.x):


    A WordPress application container inside Container Station
    Container Station VersionCommands
    3.x
    export CONTAINER_NAME={@container_name}
    cat <<EOF >> /proc/`docker inspect -f '{{.State.Pid}}' ${CONTAINER_NAME}-wordpress-1`/root/var/www/html/.htaccess
    php_value upload_max_filesize 1280M
    php_value post_max_size 1280M
    php_value memory_limit 2560M
    php_value max_execution_time 3000
    php_value max_input_time 3000
    EOF
    Replace {@container_name} with the WordPress container name.
    2.x
    export CONTAINER_NAME={@container_name}
    cat <<EOF >> /proc/`docker inspect -f '{{.State.Pid}}' ${CONTAINER_NAME}_wordpress_1`/root/var/www/html/.htaccess
    php_value upload_max_filesize 1280M
    php_value post_max_size 1280M
    php_value memory_limit 2560M
    php_value max_execution_time 3000
    php_value max_input_time 3000
    EOF
    Replace {@container_name} with the WordPress container name.
    Tip
    The WordPress container name can be found in Container Station > Overview > All > Name:
    Your terminal will look like the following (Container Station v3.x):

The file upload size limit of the WordPress application is increased.

Creating a Restore Job

  1. Go to Restore.
  2. Click Create Restore Job.

    The Create Restore Job window appears.

  3. Under Job information, specify the job information.

    Field

    Action

    Service type

    Select WordPress.

    Job name

    Specify the job name.

    The job name must be between 1 and 32 characters.

    Description (optional)

    Specify a description.

    The description can contain up to 100 characters.

  4. Under Source and Destination, specify the source application.
    1. Under Source, click Browse.
    2. Select the source type:

      Source Type

      Action

      Backup Job

      1. Click Backup Job.
      2. Select a service.

      Folder

      1. Click Folder.
      2. Select the folder that contains the source application file.
        This can be the destination folder of a backup job. For details, see Creating a Backup Job.
    3. Click Select.
  5. Under Source and Destination, specify the destination application.
    1. Under Destination, click Browse.
    2. Select a service.
    3. Click Select.
  6. Optional: Under Source and Destination > Source version, select the source version to be restored.

    Multiple source versions are available only if the corresponding backup job has version management enabled. For details on enabling version management, see Creating a Backup Job.

  7. Under Restore Schedule, specify a restore schedule:

    Schedule Type

    Description

    Manual

    Runs only when a user starts the job.

    Run once after

    Runs the job after a linked job finishes running.

    Tip
    If the linked job fails, the job will not run.
    1. Click Select a linked job.
    2. Choose a linked job.

    Run by schedule

    Runs the job on a repeating schedule.

    1. Choose one of the following and specify the relevant information:
      • One-time: Specify the date and time.
      • Daily: Specify the time.
      • Weekly: Specify the time and days of the week.
      • Monthly: Specify the time and the days of the month.
      • Periodic: Specify the date, time, and wait interval. A job with a periodic schedule runs on the date and time specified, then runs recurrently every wait interval. For example, if the wait interval is 2 hours then the job runs every two hours after its initial run.
    2. Optional: Select Set end time and specify a date and time for terminating the job schedule.
    3. Click Apply.

    A schedule is created and appears in the schedule list.

  8. Click Apply or Restore Now.

    The restore job is created.

    If you clicked Restore Now, the restore job runs immediately.

Was this article helpful?

50% of people think it helps.
Thank you for your feedback.

Please tell us how this article can be improved:

If you want to provide additional feedback, please include it below.

Choose specification

      Show more Less

      Choose Your Country or Region

      open menu
      back to top