Create an instant backup of a MAAS PostgreSQL database

Create an instant backup of a MAAS PostgreSQL database

Note

This feature is available starting from the MCP 2019.2.5 maintenance update. Before enabling the feature, follow the steps described in Apply maintenance updates.

After you create a backup schedule, you may also need to create an instant backup of a MAAS ProgreSQL database.

To create an instant backup of a MAAS PostgreSQL database using the Backupninja service:

  1. Verify that you have completed the steps described in Enable a backup schedule for a MAAS PostgreSQL database using Backupninja.

  2. Select one of the following options:

    • Create an instant backup of a MAAS PostgreSQL database automatically as described in Create an instant backup using Backupninja pipeline.

    • Create an instant backup of a MAAS PostgreSQL database manually:

      1. Verify that you have the postgresql-client-9.6 package installed on the Salt Master node. Otherwise, install it:

        salt -C 'I@backupninja:client' pkg.install postgresql-client,postgresql-client-9.6
        
      2. Verify that you have completed the steps described in Enable a backup schedule for a MAAS PostgreSQL database using Backupninja.

      3. Log in to the MAAS node, for example, cfg01.

      4. Make a backup of file_permissions.txt for MAAS:

        which getfacl && getfacl -pR /var/lib/maas/ > /var/lib/maas/file_permissions.txt
        
      5. Compress all MAAS PostgreSQL databases and store them in /var/backups/postgresql/:

        backupninja -n --run /etc/backup.d/102.pgsql
        
      6. Move the local backup files to the backupninja server using rsync:

        backupninja -n --run /etc/backup.d/200.backup.rsync