How to migrate vaultwarden data from one server to another

Daniel Garcia
February 23, 2024
Updated: August 4, 2026

Background

I’ve recently created a new Vaultwarden instance in my homelab and wanted yo migrate my old vault into the new one.

Yes, you can export the vault from the UI, but I had several family members as users and didn’t have access to their accounts, so I needed another way to migrate everything to the new instance.

For context, I run Vaultwarden in an Ubuntu LXC in my Proxmox server. I used Proxmox Community Scripts to install it.

Here’s how to migrate your Vaultwarden data

1. Backup the original data

  1. SSH into wherever you have Vaultwarden installed

  2. Locate the data directory. Depending on your Vaultwarden version, the data folder can either be in:

    • /opt/vaultwarden/data
    • /var/lib/vaultwarden/data
  3. Compress the data directory with:

tar -czvf vaultwarden_data.tar.gz /opt/vaultwarden/data
  1. Copy the compressed file to a safe space. I just transferred it to my local machine via SFTP.

2. Migrate the data to a new Vaultwarden instance

  1. Install the new Vaultwarden instance

  2. Stop Vaultwarden

systemctl stop vaultwarden
  1. Remove the default data dir
sudo rm -r /opt/vaultwarden/data
  1. Copy the compressed data file over to the new instance (I used SFTP but you can use any file transfer system you like).

  2. Uncompress the data:

tar -xzvf vaultwarden_data.tar.gz -C /
  1. Remove the old RSA keys from the data directory. These will be recreated
sudo rm /opt/vaultwarden/data/rsa_key.pem
sudo rm /opt/vaultwarden/data/rsa_key.pub.pem
  1. Change the directory ownership to vaultwarden
sudo chown -R vaultwarden:vaultwarden /opt/vaultwarden/data
  1. Restart Vaultwarden
sudo systemctl start vaultwarden

Done!

You should now be able to reach Vaultwarden at the endpoint you’ve set it up at and have all of your old vault available!

Tags:
devopensourceubuntuvaultwardenbitwarden