Skip to navigationSkip to main contentSkip to footerScaleway Docs

Transferring your data from Dedibox to Elastic Metal

dedibox
elastic-metal
migration

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

Creating an Object Storage bucket

  1. Log in to the Scaleway console.
  2. Click Storage on the side menu to view your buckets.
  3. Click Create a Bucket, enter a unique name (lowercase alphanumeric characters only), and validate.
  4. 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

Note

To ensure entropy for generating a GPG key, install and run Haveged.

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:

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.

Tip

Always check the Duplicity website for the latest version.

Creating a GPG key

  1. Generate the GPG key:
    gpg --full-generate-key
    Use default settings:
    • Key type: (1) RSA and RSA (default)
    • Key size: 3072
    • Expiration: 0 (never expires)
    • Assign a name, email, and comment.
  2. Retrieve the GPG Key fingerprint:
    gpg --list-keys

Transferring the GPG key to the Elastic Metal server

  1. Export the GPG private key:
    gpg --export-secret-key --armor "your-key-id" > ~/my-key.asc
  2. Securely transfer the key:
    scp ~/my-key.asc root@<elastic-metal>:/root/

Backing up your Dedibox

  1. 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}
  2. 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"
  3. Backup script (scw-backup.sh):
    #!/bin/bash
    source .scw-configrc
    duplicity full --encrypt-key=${GPG_FINGERPRINT} ${SOURCE} ${SCW_BUCKET}
  4. Run the backup:
    ./scw-backup.sh

Restoring data on your Elastic Metal server

  1. 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
  2. Import the GPG key:
    gpg --import ~/my-key.asc
  3. Restore script (scw-restore.sh):
    #!/bin/bash
    source .scw-configrc
    duplicity restore ${SCW_BUCKET} /destination/folder/
  4. Execute the restore script:
    ./scw-restore.sh
Tip

Duplicity can also be used for incremental backups. See How to back up your dedicated server on Object Storage with Duplicity for details.

Questions?

Visit our Help Center and find the answers to your most frequent questions.

Visit Help Center
No Results