How to use existing database for API source code?

Hi Passbolt Community,

I’m trying to use an existing database dump with the Passbolt API source code. While the command sudo su -s /bin/bash -c "./bin/cake passbolt install --force" www-data successfully runs the migration process, I’d like to avoid the migrations step and leverage my existing database.

Could you please advise on how to configure the API source code to utilize an existing database instead of performing migrations during installation?

Thanks in advance for your assistance!

Hello @Shyam-Dadhaniya

There is a dedicated command for importing an existing passbolt database dump.

sudo su -s /bin/bash -c "./bin/cake passbolt mysql_import --file <your file dump path>" www-data

If you do a passbolt install --force command, what happens normally is that you wipe everything out and it reinstalls the DB. But, you loose your data.

If you need to know what options are available with this command you can run:

sudo su -s /bin/bash -c "./bin/cake passbolt mysql_import --help" www-data
1 Like

Hii @Steph

I’m trying to migrate my Passbolt installation to a new server. I’ve already imported the MySQL dump, copied the GPG keys, and the passbolt.php file. However, after completing these steps, I’m presented with the account recovery page instead of the login page.

Is there anything else I need to do during the migration process besides copying the GPG keys, passbolt.php, and importing the MySQL dump?

Has your server domain changed?
If it’s the case, then it’s expected indeed. The reason is that the browser extension registers the domain during its setup.
It’s to ensure it reacts only on pages that it is “sure” it’s the right server.

1 Like

Yes, my server domain has changed is there any chance we can reconfigure our browser extension?

Actually, it’s the process of recovering an account that has to be followed.
So, when you access your passbolt instance, it asks for an e-mail. You just need to follow the steps.

Make sure first that you have your private key available along with its passphrase to proceed.

1 Like

Will it work for the CE (Community Edition)?

Yes the process with the email to input + providing the private key with the passphrase is the standard procedure that is available on all passbolt versions.

1 Like

By the way, if you’re not sure about the process to follow as a user, there is this page that can help you Setup on another machine or browser | Passbolt documentation.

1 Like

Thank you @Steph, It’s really helpful and I will go with this flow. If I face any challenges then I will contact you.

1 Like