Skip to main content

Backup filesystem to Object Storage with Duplicati/Kopia

Vietnix Enterprise Cloud provides S3-compatible object storage that can be used as a backup destination for various backup tools, including Duplicati and Kopia. This guide will walk you through the steps to configure both Duplicati and Kopia to upload server backups to Vietnix Object Storage.

Using Duplicati to Backup to Vietnix Object Storage​

Install and Backup Configuration​

  1. Install Duplicati on your server. You can download it from the official Duplicati website.

    Important
    • For installation instructions, refer to the Duplicati documentation.

    • We recommend using option --webservice-allowed-hostnames=* to allow access from any hostname. Adjust this setting based on your security requirements.

    Note
    • Before proceeding, ensure you have created a bucket to store your backups. If you haven't done so, refer to the Vietnix Object Storage documentation for instructions on creating a bucket.
  2. Open the Duplicati web interface and click on "Add backup" to create a new backup job. duplicati-add-backup

  3. Choose "Configure a new backup" and click "Next". duplicati-configure-backup-general

  4. Enter a name, description, and passphrase for your backup job and click "Continue".

  5. In the "Storage Type" dropdown, select "S3 Compatible".

  6. Fill in the following details:

    • Server URL: s3.vietnixcloud.com
    • Access Key: Your Vietnix Object Storage access key
    • Secret Key: Your Vietnix Object Storage secret key
    • Bucket Name: The name of the bucket you created in Vietnix Enterprise Cloud
    • Folder: (optional) Specify a folder path within the bucket
    Note

    Ensure that the "Use SSL" option is checked to secure your connection to Vietnix Object Storage. Remember to test the connection to verify that Duplicati can connect to your Vietnix Object Storage bucket.

    Important
    • Recommended additional options:
      • Force path style: Enabled
      • Disable Chunked Encoding: Enabled

    duplicati-s3-configuration

  7. Click "Continue" and configure the backup source, schedule, and other settings as needed.

  8. Save and run the backup job to start uploading your backups to Vietnix Object Storage.

Restore from Duplicati Backup​

To restore data from your Duplicati backup stored in Vietnix Object Storage, follow these steps:

  1. Open the Duplicati web interface and click on "Restore". duplicati-restore
  2. Select the backup job you created earlier.
  3. Follow the prompts to select the files you want to restore and specify the restore location.
  4. Click "Submit" to begin the restoration process. duplicati-restore-process

Using Kopia to Backup to Vietnix Object Storage​

Installation​

To install Kopia, follow the instructions on the Kopia installation page.

After installing Kopia, you can use either the Command Line Interface (CLI) or the Kopia GUI to create backups and restore data.

Using Command Line Interface (CLI)​

Create Snapshot​

To create a backup snapshot using Kopia and store it in Vietnix Object Storage, follow these steps:

  1. Initialize a new Kopia repository using the following command, replacing the placeholders with your Vietnix Object Storage details:

    Note
    • Before proceeding, ensure you have created a bucket to store your backups. If you haven't done so, refer to the Vietnix Object Storage documentation for instructions on creating a bucket.
    kopia repository create s3 --bucket <your-bucket-name> --prefix <optional-prefix> \
    --access-key <your-access-key> \
    --secret-access-key <your-secret-key> \
    --endpoint s3.vietnixcloud.com \
    --use-path-style
    tip

    After connect to Vietnix Object Storage, you can verify the connection by running:

    kopia repository status

    and it should display the repository details if the connection is successful.

    You can also use the --validate-provider flag to ensure that the S3 provider is correctly validated.

  2. Once the repository is created, you can start snapshotting data using the following command:

    tip

    Before create a snapshot, you may want to estimate the size of the snapshot by running:

    kopia snapshot estimate <path>

    After estimating, you can proceed to create the snapshot with:

    kopia snapshot create <path>

Snapshot restoration​

To restore data from your Kopia backup stored in Vietnix Object Storage, follow these steps:

  1. List the available snapshots using the command:

    kopia snapshot list
  2. Restore a specific snapshot using the command, replacing <snapshot-id> with the ID of the snapshot you want to restore:

    kopia snapshot restore <snapshot-id> --target <restore-path>

Using Kopia GUI​

Instead of using the CLI, you can also use the Kopia GUI to manage your backups and restorations. To start the Kopia GUI, follow these steps:

  1. Run the Kopia GUI by executing:

    kopia server start

    with optional flags:

    • --address <ip-address>: Specify the IP address to bind the server: default is http://127.0.0.1:51515.
    • --tls-cert <path-to-cert> and --tls-key <path-to-key>: Specify the TLS certificate and key files for secure connections, or use --tls-generate-cert to generate a self-signed certificate. If TLS is enabled, access the GUI via https://<ip-address>:<port>. If TLS is not enabled, use http://<ip-address>:<port> with flag --insecure.
    • --server-username <username> and --server-password <password>: Set a username and password for accessing the GUI.
  2. Open your web browser and navigate to http://<server-public-ip>:<port> (default port is 51515).

  3. In the Kopia GUI, click on "Add Repository" and select "S3 Compatible" as the repository type.

    tip

    If you already have a Kopia repository created via CLI, the repository will be automatically detected when you open the GUI.

  4. Fill in the Vietnix Object Storage details:

    • Bucket Name: The name of your Vietnix Object Storage bucket
    • Access Key: Your Vietnix Object Storage access key
    • Secret Key: Your Vietnix Object Storage secret key
    • Endpoint: s3.vn-hcm-1.vietnix.cloud

    Kopia S3 Repository Setup

  5. Press "Connect" to establish the connection to your Vietnix Object Storage bucket.

  6. Input passphrase for the repository and click "Create Repository".

    Kopia Repository Passphrase

  7. Once connected, you can create snapshots by selecting the desired files or directories and clicking on "Create Snapshot".

    Kopia Homepage

Create Snapshot With GUI​

  1. In the Kopia GUI, Press the "Create Snapshot" button.

  2. Select the files or directories you want to back up, estimate the snapshot size if needed, and then click "Snapshot Now" to start the backup process. Kopia Create Snapshot

    tip

    You can customize snapshot settings such as scheduling, retention policies, and more in the settings menu.

    After the snapshot is created, you can view the backup details and manage your snapshots directly from the Kopia GUI.

    Kopia Snapshot Details

Restore Snapshot With GUI​

To restore data from your Kopia backup stored in Vietnix Object Storage using the GUI, follow these steps:

  1. In the Kopia GUI, navigate to Snapshots Details.

  2. Click on the snapshot you want to restore. Kopia Snapshots

  3. Press the "Restore File & Directories" button.

    Note

    You can choose to mount the snapshot as a local file with button "Mount as Local FileSystem"

  4. Select the files or directories you want to restore and specify the restore location. Kopia Restore Selection

  5. Click "Restore Now" to begin the restoration process.

You can select Tasks button on navigation menu to monitor the restoration progress. Kopia Tasks

By following these steps, you can effectively use Duplicati and Kopia to back up your server data to Vietnix Enterprise Cloud's S3-compatible storage and restore it when needed.

Additional Resources​