Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: restore pg cluster implementation #418

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

wai-wong-edb
Copy link
Collaborator

@wai-wong-edb wai-wong-edb commented Dec 1, 2023

Steps to restoring deleted cluster:

  1. Use an example config in the examples folder, uncomment the following fields restore_cluster_id=p-123456789, restore_from_deleted=true and enter your cluster id you want to restore and set to true respectively(for restoring an active cluster, set to false)
  2. Use commands terraform init and terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789/import-from-deleted to import a deleted cluster into terraform(use import biganimal_cluster.single_node_cluster prj_123456789/p-123456789 to import an active cluster)
  3. Use command terraform plan to compare and diff your config with the imported cluster(source cluster) and edit config where appropriate. You can also use terraform show to see the source cluster which you can copy and paste the field values into your config
  4. Remove state by deleting the file terraform.tfstate or use the commands terraform state rm 'biganimal_cluster.single_node_cluster' and terraform state rm 'random_password.password'
  5. Use command terraform init and terraform apply to restore the cluster, it will show a warning saying you are trying to restore a cluster
  6. Remove or comment the field restore_cluster_id=p-123456789 in the config after the restore has completed

@wai-wong-edb wai-wong-edb force-pushed the ww-pg-restore branch 2 times, most recently from 85bede1 to 77b3fa8 Compare December 1, 2023 16:09
@wai-wong-edb wai-wong-edb marked this pull request as draft December 4, 2023 10:17
@wai-wong-edb wai-wong-edb marked this pull request as ready for review December 4, 2023 15:08
@wai-wong-edb wai-wong-edb force-pushed the ww-pg-restore branch 2 times, most recently from bf616f2 to 74118c8 Compare December 5, 2023 18:31
# Conflicts:
#	docs/resources/cluster.md
#	examples/resources/biganimal_cluster/ha/resource.tf
#	examples/resources/biganimal_cluster/single_node/aws/resource.tf
#	examples/resources/biganimal_cluster/single_node/azure/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf
#	examples/resources/biganimal_cluster/single_node/gcp/resource.tf
#	examples/resources/biganimal_cluster/single_node/resource.tf
#	pkg/provider/resource_cluster.go
@wai-wong-edb wai-wong-edb added the parked Parked label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked Parked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant