9951 explained code solutions for 126 technologies


amazon-redshiftHow do I create a backup of my Amazon Redshift database?


Creating a backup of an Amazon Redshift database requires a few steps.

  1. Create a snapshot of the cluster:
aws redshift create-cluster-snapshot --cluster-identifier <cluster-name> --snapshot-identifier <snapshot-name>

This will create a snapshot of the cluster, which is saved to Amazon S3.

  1. Create a manual snapshot copy:
aws redshift copy-cluster-snapshot --source-snapshot-identifier <source-snapshot-name> --target-snapshot-identifier <target-snapshot-name>

This will create a manual snapshot copy, which can be used to restore the cluster to a specific point in time.

  1. Create a manual snapshot copy from a different region:
aws redshift copy-cluster-snapshot --source-snapshot-identifier <source-snapshot-name> --target-snapshot-identifier <target-snapshot-name> --source-region <source-region> --target-region <target-region>

This will create a manual snapshot copy from a different region, which can be used to restore the cluster in a different region.

  1. Restore a cluster from a snapshot:
aws redshift restore-from-cluster-snapshot --cluster-identifier <cluster-name> --snapshot-identifier <snapshot-name>

This will restore a cluster from a snapshot, which can be used to create a new cluster with the same data as the original.

These steps will create a backup of an Amazon Redshift database.

Helpful links

Edit this code on GitHub