Automated restoration of a backup #5703

Closed
opened 2022-05-17 08:13:35 +02:00 by palmtree5 · 4 comments
palmtree5 commented 2022-05-17 08:13:35 +02:00 (Migrated from github.com)

Type of feature request

Other

Description of the feature you're suggesting

The intention here is to have a restore function that would automatically restore from a backup, including:

  • Restoring the instance data to a user-defined location
  • Readd cog repos the user had added using [p]repo add
  • Readd cogs the user installed with [p]cog install

Anything else?

Note: I am intending to work on this myself at some point in the near future

### Type of feature request Other ### Description of the feature you're suggesting The intention here is to have a restore function that would automatically restore from a backup, including: - [ ] Restoring the instance data to a user-defined location - [ ] Readd cog repos the user had added using `[p]repo add` - [ ] Readd cogs the user installed with `[p]cog install` ### Anything else? Note: I am intending to work on this myself at some point in the near future
Vexed01 commented 2022-05-17 08:28:25 +02:00 (Migrated from github.com)

Possible duplicate of #2947 / #3681

Possible duplicate of #2947 / #3681
palmtree5 commented 2023-10-12 03:59:54 +02:00 (Migrated from github.com)

So what I think I want to do here in terms of how to actually automate the restoration of a backup would ultimately have the user's steps be:

  1. Stop your existing instance
  2. Create a backup using redbot-setup backup
  3. Copy the backup to the new machine
  4. Install Red (with Postgres, if using it), stopping at the point of creating an instance
  5. Run redbot-setup restore <backup_file> to restore, which will then get everything set up, including redownloading installed repos and cogs.

The goal here in my mind is to basically recreate the environment as it was when the backup was made, ideally including using the same storage backend that was in use when the backup was created (i.e. if the backup was made on an instance that was using Postgres as the config backend, on restore we would convert back from JSON to Postgres)

So what I think I want to do here in terms of how to actually automate the restoration of a backup would ultimately have the user's steps be: 1. Stop your existing instance 2. Create a backup using `redbot-setup backup` 3. Copy the backup to the new machine 4. Install Red (with Postgres, if using it), stopping at the point of creating an instance 5. Run `redbot-setup restore <backup_file>` to restore, which will then get everything set up, including redownloading installed repos and cogs. The goal here in my mind is to basically recreate the environment as it was when the backup was made, ideally including using the same storage backend that was in use when the backup was created (i.e. if the backup was made on an instance that was using Postgres as the config backend, on restore we would convert back from JSON to Postgres)
cswimr commented 2024-02-01 03:22:33 +01:00 (Migrated from github.com)

I've created a cog (SeaCogs/Backup) that does some of the things this issue discusses, namely allowing for "automatic" installation of repositories and cogs when migrating. It reuses a lot of Downloader code, and works pretty well. However, some of the things I want to do with it are held back by it being a cog, and therefore having to run both manually and AFTER the bot initializes. It would be a lot better to incorporate something like this into Core. That way cogs that were loaded before stay loaded when the bot starts, because it's already cloned all of the repos/cogs before that point. Here's a Discord message link to a conversation Flame and I had about this idea in #coding.

I've created a cog ([SeaCogs/Backup](https://c.csw.im/cswimr/SeaCogs/src/branch/main/backup/backup.py)) that does some of the things this issue discusses, namely allowing for "automatic" installation of repositories and cogs when migrating. It reuses a lot of Downloader code, and works pretty well. However, some of the things I want to do with it are held back by it being a cog, and therefore having to run both manually and AFTER the bot initializes. It would be a lot better to incorporate something like this into Core. That way cogs that were loaded before stay loaded when the bot starts, because it's already cloned all of the repos/cogs before that point. Here's a [Discord message link](https://discord.com/channels/133049272517001216/160386989819035648/1202350112941289505) to a conversation Flame and I had about this idea in `#coding`.
Jackenmen commented 2026-05-16 01:15:51 +02:00 (Migrated from github.com)

Should be fixed by #6709

Should be fixed by #6709
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#5703
No description provided.