Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

The database-backup tasks will NOT work be skipped when an external MySQL (like Amazon RDS) is configured. Please read the notes below.

Table of Contents
Overview

...

  • config backup, which backs up all configuration, gpg keys, rails secrets and user seed files in /etc/packagecloud/*

  • database backup, which is an percona xtrabackup [link] of the database

Settings

Backup configuration is located under the backups namespace in /etc/packagecloud/packagecloud.rb.

No Format
# Controls whether config backups are taken regularly
backups['config_backup'] = false

# Controls whether database backups are taken regularly
backups['database_backup'] = false

# Where to store backups locally
backups['local_backup_path'] = "/var/opt/packagecloud/backups"

# Where to store backups on S3
backups['remote_backup_path'] = "backups"

# Controls whether we should upload backups to S3
backups['s3_upload'] = true

# How many backups to keep around
backups['keep_num'] = 10

# How often to take automatic backups, in seconds
backups['frequency'] = 86400 # 24 hours

# S3 Credentials
backups['aws_access_key'] = "XXXXXXXXXXXXX"
backups['aws_secret_key'] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

# Controls whether we should try to create the bucket before upload
backups['aws_create_bucket'] = true

# Name of S3 bucket to place backups
backups['aws_bucket_name'] = "packagecloud-backups-023f"

# S3 Region to use
backups['aws_region'] = "us-west-2"


Note that a backup to the local disk is always taken if backups are enabled. Enabling "s3_upload" in the backup configuration will upload the backup to s3 in addition to storing the file locally.

Manual backups

It is recommended that users take a backup prior to upgrading their packagecloud installation, especially if automatic backups are turned off.

You can take a backup at any time using any of the following commands:

CommandPurpose and Side Effects
sudo packagecloud-ctl backup-

...

databaseCreate a database backup. This commands has no effect for external databases like Amazon RDS. Please see the Amazon RDS documenation for more information.
sudo packagecloud-ctl backup-config

...

Create a configuration file backup.
sudo packagecloud-ctl backup-all

...

Create both a configuration file and database backup. As mentioned above, the database backup is skipped for Amazon RDS. Please see the Amazon RDS documenation for more information.


Note: Manual backups do not produce any logs, only STDOUT

...

To get a list of all database backups taken, run the following commands: sudo packagecloud-ctl backup-database-list or sudo packagecloud-ctl backup-config-list for config backups.

...