Skip to content

Latest commit

 

History

History
119 lines (71 loc) · 4.3 KB

manual-script_integrate_bkup.md

File metadata and controls

119 lines (71 loc) · 4.3 KB

Enabling backup script for legacy manual deployment

This document and the steps therein are aimed at operators that have deployed their nodes using the legacy manual script deployment method.

The legacy manual script deployment method is defined as having created & edited the following files; as part of the medium articles & subsequent community member tutorials that referenced these same articles.

  • apicredentials.txt
  • password.txt

Legacy medium articles (now deprecated)


How to integrate the automated scripts

In order to utilise the backup script so that you can quickly recover your node to either the same VPS or an entirely different VPS with another provider, you need to perform a number of steps which are set out below.

Integration steps

### CAUTION : Be sure to have taken a manual record of all your credentials before proceeding ###


  1. Copy the legacy credentials files to conform with the updated standard.

    The following table shows the transform path from legacy to updated;

    Legacy Updated
    apicredentials.txt .env.apicred
    password.txt .env.password

    run the following commands to achieve the file standardisation;

      cd ~/plugin-deployment
      cp apicredentials.txt .env.apicred
      cp password.txt .env.password
      cp 2_nodeStartPM2.sh 2_nodeStartPM2.sh.orig
      cp 3_initiatorStartPM2.sh 3_initiatorStartPM2.sh.orig
    

  1. Update the scripts repositoty from github (Over writes existing config files)

      cd ~/plugin-deployment
      git fetch
      git reset --hard HEAD
      git merge '@{u}'
      chmod +x *.sh
    

  1. Restore your process run & credentials files

      cd ~/plugin-deployment
      cp .env.apicred apicredentials.txt
      cp .env.password password.txt
      cp 2_nodeStartPM2.sh.orig 2_nodeStartPM2.sh
      cp 3_initiatorStartPM2.sh.orig 3_initiatorStartPM2.sh
    

  1. Create the new vars file for your node

      cd ~/plugin-deployment && cp -n sample.vars ~/"plinode_$(hostname -f)".vars
      chmod 600 ~/"plinode_$(hostname -f)".vars
    

  1. Update the new vars file with your nodes credentials

    This is the important piece. When updating the vars file, it is critically important that you maintain the accuracy of credentials otherwise when you come to restore the node, you may discover issues related to incorrect credentials

    The following credentials must be updated into the new vars file;

    • KeyStore Password (sourced from the password.txt file)
    • Postgres Password (sourced from the 2_nodeStartPM2.sh file)
    • API Username & Password (sourced from the apicredentials.txt file)
    • The following variables inside the new vars file are what require updating with your values from above.

      IMPORTANT: You must ensure that formatting of each variable field it maintained.

      • PASS_KEYSTORE='$oM3$tr*nGp4$$w0Rd$'
      • DB_PWD_NEW="testdbpwd1234"
      • API_EMAIL="[email protected]"
      • API_PASS='passW0rd123'

      You will notice the variation in types of quotations that the values are wrapped in. This format MUST be maintained.

    Below is an example of the values generated & stored by the autosetup script;

    • PASS_KEYSTORE='Xqe7.?2p+8Ox.hOWQs+IMJYy!7ZJW+tF'
    • DB_PWD_NEW="s8kZVmapDgkwAEa5cbdgFU9XqcuZ3z"
    • API_EMAIL="[email protected]"
    • API_PASS='Vw5hps4SPIcN6dWRDH'

    NOTE : The above values are taken from a private development host which is regularly erased

To edit your new vars file using the guidelines set out above, run the command;

     nano ~/"plinode_$(hostname -f)".vars

In this example I use nano but you can replace this with the editor that you are more comfortable with e.g. vim, vi etc.


  1. Setup the backup folder & permissions.

      cd ~/plugin-deployment &&  ./_plinode_setup_bkup.sh
    
  2. Perform a Full Backup of your node

  3. Validate your backup with a restore to a temporary test / sandbox VPS