File Backup and Restore using Elastio
Abhishek Sharma
November 18, 2022
Aim: To Backup files from Ubuntu multipass instance and restore on EC2 instance
Website: https://docs.elastio.com/
Installation and set-up
1. Install and configure AWS
- curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
- unzip awscliv2.zip
- sudo ./aws/install
- Run aws --version
- Configure credentials using aws configure
2. Elastio CLI Installation
-
sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/elastio/elastio-stack/master/scripts/install-elastio.sh)"
-
elastio --version ----to verify
-
Create a new vault (optional)
elastio vault init <vault-name>
elastio vault init alpha
-
Run: elastio vault list : alpha
3. File Backup on Multipass Instance
On Multipass instance (backup)
- Create a file on the multipass instance called elastio.txt with contents
- Back up the file using the command:
elastio file backup /home/ubuntu/elastio.txt --vault alpha
- Check elastio rp list: elastio rp list
- Take note of the rp: r-dghhq0lzih4ls29d2mldvo7l
4. File Restore on EC2 instance
On Ec2 instance (restore)
- Create a restore point called restore-ec2: mkdir restore-point
- Copy the rp: r-dghhq0lzih4ls29d2mldvo7l
- Restore the rp using the command:
elastio file restore --rp r-dghhq0lzih4ls29d2mldvo7l --vault alpha --target-dir /home/ubuntu/restore-point
- cd into restore-point and
- ls (and you will see the file called elastio.txt)
- Success!
5. Clean Up Elastio Deployment
You can clean elastio deployment in the following steps:
5.1. Delete the Elastio vault Use the following command to delete an Elastio vault:
elastio vault delete --vault <vault-name>
5.2. Destroy the Elastio Stack The Elastio stack is the CloudFormation stack and should be manually deleted after first removing the Cloud Connector. The Cloud Connector is found in, and can be removed from, the CloudFormation section in the AWS console.
Use the following command to destroy the CloudFormation stack:
elastio stack destroy
5.3. Remove the Elastio Shell Run the following command to remove the Elastio Shell:
pip3 uninstall elastio_shell
5.4. Remove the Elastio CLI The next step when cleaning up the Elastio Deployment is to uninstall or remove the Elastio CLI. This is achieved in the following manner.
Use the following script to uninstall the Elastio CLI and Elastio Snap:
sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/elastio/elastio-stack/master/scripts/install-elastio.sh) $0" -- -u