Backing Up and Restoring Morpheus Appliance

Morpheus includes built-in tools for backing up managed Instances as well as the appliance itself. Use this guide to configure a location and schedule for backing up your Morpheus appliance. This guide also includes steps for restoring or migrating your appliance from the created backup. The steps are the same whether your appliance is deployed in a single node or distributed architecture.

The built-in Morpheus appliance backup functionality backs up the MySql data. In addition to the database, it’s advisable to back up your shared storage (at /var/opt/morpheus/morpheus-ui) and the morpheus.rb configuration file.

Note

The destination Morpheus appliance must be running the same version as that which the backup was taken from.

Create A Backup Job

A Backup Job in Morpheus holds the schedule timing and retention count for automated backups. If you already have a Job configured, you can move on to the next section. By default, Morpheus includes two execution schedules: Daily at Midnight and Weekly on Sunday at Midnight. If currently-existing options do not make sense for your backup needs, create a new execution schedule:

  1. Navigate to Provisioning > Automation
  2. Click on the “Execute Scheduling” tab
  3. Click + ADD
  4. Enter schedule timing using cron notation
  5. Click SAVE

With the execution schedule created, we can move on to creating the Backup Job itself. A Backup Job includes both the backup retention count and an execution schedule (which we just created).

  1. Navigate to Backups > Jobs
  2. Click + ADD
  3. Name the Job, then configure the retention count and the schedule
  4. Click SAVE

Integrate a Bucket or File Share

When configuring a Morpheus appliance backup, a storage location is selected. If you already have the destination bucket or file share integrated with Morpheus, skip to the next section.

  1. Navigate to Infrastructure > Storage
  2. Click on the Buckets or File Shares tab depending on your chosen storage type
  3. Click + ADD
  4. Select the appropriate bucket or file share type
  5. Complete the required fields and click SAVE CHANGES

Note

Additional guidance on integrating each of the supported bucket and file share types can be found elsewhere in Morpheus documentation.

Configuring Morpheus Appliance Backup

With the groundwork laid in the previous sections, we’re ready to enable and configure Morpheus appliance backup.

  1. Navigate to Administration > Backups
  2. Slide the switch labeled “Backup Appliance”
  3. Click SAVE

On saving this change, a text link labeled “Backup” will be activated which will take you directly to the automatically-generated appliance backup job. Click this link to continue.

  1. Click EDIT
  2. Enter a name for the appliance backup job
  3. Select an integrated storage bucket or file share
  4. Choose a pre-created backup job. If you do not have an existing backup job that fits, a retention count and schedule can be manually created in this modal. If you manually configure retention counts and schedules in addition to associating a Job, the Job values will override any manual settings.
  5. Click SAVE CHANGES

At this point, your appliance will be automatically backed up on the schedule you chose and stored in the selected location. An appliance backup will store backup copies of the appliance MySQL database. Should you need to restore or migrate your database from backup, follow the steps in the next section of this guide.

Restoring an Appliance from Backup

Begin by ensuring the Morpheus UI service is stopped on all of the application servers:

[root@app-server-new ~] morpheus-ctl stop morpheus-ui

To access the MySQL shell we will need the password for the Morpheus DB user. We can find this in the morpheus-secrets file:

[root@app-server-old ~] cat /etc/morpheus/morpheus-secrets.json | grep morpheus_password
"morpheus_password": "451e122cr5d122asw3de5e1b", <---- this one
"morpheus_password": "9b5vdj4de5awf87d",

Make note of the first morpheus_password value as indicated above.

Copy the SQL database backup from the backup bucket or file share to an appliance node at /tmp/morpheus_backup.sql. Then, you can import the MySQL dump into the target database using the embedded MySQL binaries, specifying the database host, and entering the password for the morpheus user when prompted:

[root@app-server-new ~] /opt/morpheus/embedded/mysql/bin/mysql -u morpheus -h 10.1.2.2 morpheus -p < /tmp/morpheus_backup.sql
Enter password:

The data form the old appliance is now replicated on the new appliance. Simply start the UI to complete the process:

[root@app-server-new ~] morpheus-ctl start morpheus-ui