Transferring your data from Dedibox to Elastic Metal
This tutorial provides step-by-step guidance for migrating your existing data from a Dedibox to an Elastic Metal server, ensuring improved stability, performance, and reliability.
We use Duplicity to encrypt the backup and upload it to Object Storage. Then, we download and decrypt the data on the Elastic Metal server.
Before you start
To complete the following actions, you must have:
Prerequisites
- A Scaleway account logged into the console (External link)
- Owner status or appropriate IAM permissions
- An SSH key
- A Dedibox server
- Created and installed an Elastic Metal server
Creating an Object Storage bucket
- Log in to the Scaleway console.
- Click Storage on the side menu to view your buckets.
- Click Create a Bucket, enter a unique name (lowercase alphanumeric characters only), and validate.
- Ensure the correct region is selected (e.g.,
s3.fr-par.scw.cloud,s3.nl-ams.scw.cloud).
Installing software requirements on the Dedibox Server
Run the following commands to update your system and install Duplicity:
apt update && apt upgrade -y
apt install -y python3-boto3 python3-pip haveged gettext librsync-dev pipx
python3 -m pip install --upgrade pipInstalling Duplicity
Choose one of the following installation methods, depending on whether you want to install for all users or just the current user:
Install for all users (recommended)
sudo pipx --global install duplicityThis will install Duplicity in /usr/local/bin/duplicity and its dependencies in /opt/pipx/venvs/duplicity.
Install for current user only
pipx install duplicityThis will install Duplicity in ~/.local/bin/duplicity and its dependencies in ~/.local/pipx/venvs/duplicity.
For more information, visit the Duplicity GitLab page (External link).
Creating a GPG key
- Generate the GPG key:
Use default settings:Copy
gpg --full-generate-key- Key type: (1) RSA and RSA (default)
- Key size: 3072
- Expiration: 0 (never expires)
- Assign a name, email, and comment.
- Retrieve the GPG Key fingerprint:
Copy
gpg --list-keys
Transferring the GPG key to the Elastic Metal server
- Export the GPG private key:
Copy
gpg --export-secret-key --armor "your-key-id" > ~/my-key.asc - Securely transfer the key:
Copy
scp ~/my-key.asc root@<elastic-metal>:/root/
Backing up your Dedibox
- Create the necessary files and directories:
Copy
touch scw-backup.sh .scw-configrc chmod 700 scw-backup.sh chmod 600 .scw-configrc mkdir -p /var/log/duplicity touch /var/log/duplicity/logfile{.log,-recent.log} - Add the following configurations to
.scw-configrc:Copyexport AWS_ACCESS_KEY_ID="<SCALEWAY ACCESS KEY>" export AWS_SECRET_ACCESS_KEY="<SCALEWAY SECRET ACCESS KEY>" export SCW_BUCKET="s3://s3.fr-par.scw.cloud/<YOUR BUCKET>" export PASSPHRASE="<YOUR GPG KEY PASSPHRASE>" export GPG_FINGERPRINT="<YOUR GPG KEY FINGERPRINT>" export SOURCE="<PATH TO BACKUP>" export LOGFILE_RECENT="/var/log/duplicity/logfile-recent.log" export LOGFILE="/var/log/duplicity/logfile.log" - Backup script (
scw-backup.sh):Copy#!/bin/bash source .scw-configrc duplicity full --encrypt-key=${GPG_FINGERPRINT} ${SOURCE} ${SCW_BUCKET} - Run the backup:
Copy
./scw-backup.sh
Restoring data on your Elastic Metal server
- Install required packages:
Copy
apt update && apt upgrade -y apt install -y python3-boto3 python3-pip gettext librsync-dev pipx python3 -m pip install --upgrade pip sudo pipx --global install duplicity - Import the GPG key:
Copy
gpg --import ~/my-key.asc - Restore script (
scw-restore.sh):Copy#!/bin/bash source .scw-configrc duplicity restore ${SCW_BUCKET} /destination/folder/ - Execute the restore script:
Copy
./scw-restore.sh
Visit our Help Center and find the answers to your most frequent questions.
Visit Help Center