MySQL replication


I need to run another instance of passbolt for failover. Is it possible to just have MySQL db replicated a second server and use it as a failover for passbolt?

Hi @Blacky,

If you connect to your server and run the following command:

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

that you can perform on a regular basis,

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

for… well kind of obvious :slight_smile:

feel free to add the --help at the end of each to see the options


1 Like

Thank you for the reply. I needed a set up as follows;

  • Server 1:
  • Server 2:
    I need the 2 servers to have an exact copy of the dbs, so that when one is down, the other can be used. Is it possible to have this?

You will need also to import the keys to the new server to decrypt the passwords in database

I’m actually working on a post addressing this topic! It won’t be an automatic failover but it is possible

Along with what @Termindiego25 says you can follow the official MariaDB guide on this.

I set this up as a test by essentially just doing a migration to a new server so that passbolt was also installed there, shut down nginx on the 2nd server and set it up as a replica.

If you go with a different domain name for the 2nd server you’ll need to do an account recovery to failover.

I will try later today. Just curious, why shutdown nginx in the send server?

If you use GTIDs it can cause an issue if someone makes a change on the replica. Essentially just to make sure users are on the primary and not the replica