How to Migrate Passbolt to Another Server Step By Step Guide

Learn how to move your old passbolt installation to the newer passbolt version. Simple step by step guide to get this started. Less than 1 hour.

I have been using passbolt as my password manager for a long time, but I wanted to move to a newer version with the phone app. Unfortunately, passbolt does not have a simple one-click upgrade functionality for this. So here is my guide on how to move from one server to another.

1. The first thing you must do is to install Passbolt on another server

2. Secondly you must backup your data from the existing server.

How to backup your data?

1. We must backup our database first

mysqldump -u[user] -p[pass] [db] > /path/to/backup.sql

2. You must copy your public and private keys for the server. These are located in the config/gpg folder

  • private key is serverkey_private.asc
  • public key is serverkey.asc

3. We must backup the application configuration file. This one is located in config/passbolt.php

4. If you have a version prior to 3.2 you must move the avatars.

sudo tar cvfzp passbolt-avatars.tar.gz -C /var/www/passbolt/ webroot/img/avatar

So after you are done with the backup we will start moving this data over.

How to Move the Data Over?

NOTE: Make sure your database on the new server does not have anything installed yet.

1. First restore your configuration file from another server. If you need to change domain you can change it later.

sudo mv ~/backup/passbolt.php /etc/passbolt
sudo chown www-data:www-data /etc/passbolt/passbolt.php
sudo chmod 440 /etc/passbolt/passbolt.php

2. Then we need to restore our GPG public and private keys

sudo mv ~/backup/serverkey.asc /etc/passbolt/gpg
sudo mv ~/backup/serverkey_private.asc /etc/passbolt/gpg
sudo chown www-data:www-data /etc/passbolt/gpg/serverkey_private.asc
sudo chown www-data:www-data /etc/passbolt/gpg/serverkey.asc
sudo chmod 440 /etc/passbolt/gpg/serverkey.asc
sudo chmod 440 /etc/passbolt/gpg/serverkey_private.asc

3. We then need to extract the passbolt avatars into the new server if you are coming from a prior 3.2 version

sudo tar xzf passbolt-avatars.tar.gz -C /usr/share/php/passbolt/
sudo chown -R www-data:www-data /usr/share/php/passbolt/webroot/img/public

4. We then need to load the database

mysql -u PASSBOLT_DATABASE_USER -p PASSBOLT_DATABASE < passbolt-backup.sql

5. After we load the database we need to make sure we run the migration script.

sudo -H -u www-data /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt migrate"

6. This completes the process. Test your application on the web first if you see any problems you can run this script to check for any issues.

sudo -H -u www-data /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt healthcheck"