Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Db backup restore #877

Closed
wants to merge 10 commits into from
Closed

Conversation

Keyrxng
Copy link
Member

@Keyrxng Keyrxng commented Oct 25, 2023

Resolves #865

Quality Assurance:

  • Considering this will be ran in a private repo, it was difficult to think of a way to showcase it and this was the best way I could think, mobile users beware.

  • I wasn't sure if you'd want to keep previous dumps so I've timestamped each and the restore action looks for dump files with no timestamp. I wasn't sure of a cleaner way to do this, I considered just backing up straight to another Supabase instance but this was there's a history of backups I guess.

  • Pushing the backup files you want to use into a branch called restore will restore things, I felt this was the cleanest way with my understanding that restores would rarely ever need to happen


Dump Commit

Dump commit


Restore Action

Restore action


Empty DB

empty-db


Restored DB

filled-db

@netlify
Copy link

netlify bot commented Oct 25, 2023

Deploy Preview for ubiquibot-staging ready!

Name Link
🔨 Latest commit 328dbd5
🔍 Latest deploy log https://app.netlify.com/sites/ubiquibot-staging/deploys/654cbc035de8f80008657da4
😎 Deploy Preview https://deploy-preview-877--ubiquibot-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Keyrxng Keyrxng marked this pull request as ready for review October 25, 2023 23:24
@Keyrxng Keyrxng requested a review from 0xcodercrane as a code owner October 25, 2023 23:24
@0x4007 0x4007 requested a review from rndquu November 8, 2023 14:28
Copy link
Member

@rndquu rndquu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Keyrxng Could you reopen the current PR to this public repo https://github.com/ubiquity/ubiquibot-db-backups ? Once it is merged I'll make it private.

.github/workflows/backup-db.yml Outdated Show resolved Hide resolved
.github/workflows/backup-db.yml Outdated Show resolved Hide resolved
.github/workflows/restore-db Outdated Show resolved Hide resolved
@rndquu
Copy link
Member

rndquu commented Nov 10, 2023

@Keyrxng What should be specified in the SUPABASE_DB_URL env variable? Connection URI like postgresql://postgres:[YOUR-PASSWORD]@db.qwerty.supabase.co:5432/postgres ?

@rndquu
Copy link
Member

rndquu commented Nov 20, 2023

@Keyrxng What should be specified in the SUPABASE_DB_URL env variable? Connection URI like postgresql://postgres:[YOUR-PASSWORD]@db.qwerty.supabase.co:5432/postgres ?

@pavlovcik We need to set the SUPABASE_DB_URL env variable in this repo https://github.com/ubiquity/ubiquibot-db-backups to enable DB backups. You can either DM me the supabase DB password from the prod's DB either set the SUPABASE_DB_URL string yourself (this is basically a URI similar to postgresql://postgres:[YOUR-PASSWORD]@db.qwerty.supabase.co:5432/postgres)

@0x4007
Copy link
Member

0x4007 commented Nov 21, 2023

I think I updated the environment variable correctly. However I had some authentication issues.

I sent you everything you need in a direct message in case this doesn't work.

github com_ubiquity_ubiquibot-db-backups_settings_secrets_actions

Copy link
Member

@rndquu rndquu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, dumps are created https://github.com/ubiquity/ubiquibot-db-backups

Closing the current PR because the "DB backup" workflow is implemented here

@rndquu rndquu closed this Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DB backup
3 participants