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

Backup a running darknode and restore it. #59

Open
tok-kkk opened this issue Apr 15, 2020 · 0 comments
Open

Backup a running darknode and restore it. #59

tok-kkk opened this issue Apr 15, 2020 · 0 comments
Assignees
Labels
feature New feature or request wip Work in progress
Milestone

Comments

@tok-kkk
Copy link
Member

tok-kkk commented Apr 15, 2020

Object

  • We want the CLI to be able to backup a darknode from its current status to a single file with password encryption.
  • We want the CLI to be able to restore a darknode from the backup file by providing the correct password.
    These will give us the ability to migrate darknode to another VPS.

Design

We'll introduce a new command backup to backup the current status of a darknode.
It should take a string parameter which is the darknode name and

  1. SSH into the darknode and stop the darknode service.
  2. Create a copy for the database and config file
  3. Compress the files into a tarball and encrypt it using openssl enc command
  4. Clean up those temporary files.
  5. Download the encrypted file to the provided location.

Reason we don't use zip is that it's not pre-installed in ubuntu. Source for using openssl

When restoring the backup, we can

  1. Integrate it with current up command.

Or

  1. have a new restore command.

We'll introduce a new flag which takes a backup file.
It should

  1. Check existence of the backup file and try to decrypt it with given password.
  2. Deploy the instance as normal
  3. Copy backup file to the instance.
  4. Extract files from the tarball.
  5. Setup service and start darknode as normal.
  6. Clean up

We should also let the user know the darknode will be stopped by running the backup command.

Discussion

  • Do we want to have a new command when restoring the darknode?
  • Do we want to restart the darknode service after finishing backup?
  • Do we want to support batch operation for the backup command? (i.e. allow --tags option)
@tok-kkk tok-kkk added the feature New feature or request label Apr 15, 2020
@tok-kkk tok-kkk added this to the v3.1.0 milestone Apr 15, 2020
@tok-kkk tok-kkk self-assigned this Apr 15, 2020
@tok-kkk tok-kkk changed the title Backup a running darknode and restore it. [WIP]Backup a running darknode and restore it. Apr 16, 2020
@loongy loongy changed the title [WIP]Backup a running darknode and restore it. Backup a running darknode and restore it. Apr 21, 2020
@loongy loongy added the wip Work in progress label Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request wip Work in progress
Projects
None yet
Development

No branches or pull requests

2 participants