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 actions presented below, you must have:
Prerequisites
- A Scaleway account logged into the console
- 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 pip
Installing 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 duplicity
This will install Duplicity in /usr/local/bin/duplicity
and its dependencies in /opt/pipx/venvs/duplicity
.
Install for current user only
pipx install duplicity
This will install Duplicity in ~/.local/bin/duplicity
and its dependencies in ~/.local/pipx/venvs/duplicity
.
For more information, visit the Duplicity GitLab page.
Creating a GPG key
- Generate the GPG key:
Use default settings:
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:
gpg --list-keys
Transferring the GPG key to the Elastic Metal server
- Export the GPG private key:
gpg --export-secret-key --armor "your-key-id" > ~/my-key.asc
- Securely transfer the key:
scp ~/my-key.asc root@<elastic-metal>:/root/
Backing up your Dedibox
- Create the necessary files and directories:
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
:export 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
):#!/bin/bash source .scw-configrc duplicity full --encrypt-key=${GPG_FINGERPRINT} ${SOURCE} ${SCW_BUCKET}
- Run the backup:
./scw-backup.sh
Restoring data on your Elastic Metal server
- Install required packages:
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:
gpg --import ~/my-key.asc
- Restore script (
scw-restore.sh
):#!/bin/bash source .scw-configrc duplicity restore ${SCW_BUCKET} /destination/folder/
- Execute the restore script:
./scw-restore.sh
Visit our Help Center and find the answers to your most frequent questions.
Visit Help Center