Error Migrating Database

Importing mysqldump backup from old passbolt server to new passbolt server

Resources I have from the old server:

passbolt.php
/gpg/serverkey_private.asc
/gpg/serverkey.asc
/gpg/unsecure_private.key
/gpg/unsecure.key
backup-2019-08-29.sql

Setup new passbolt server successfully,
had to create new gpg key due to old one having an expiry (couldn’t import)
imported the exported sql via ./cake passbolt mysql_import

passbolt now gets stuck loading

have not tried importing gpg (not sure how)
have not tried importing passbolt.php (some configuration has changed)

healtcheck:

ubuntu@passbolt:/var/www/passbolt/bin$ sudo -u www-data ./cake passbolt healthcheck


     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
---------------------------------------------------------------
 Healthcheck shell
---------------------------------------------------------------

 Environment

 [PASS] PHP version 7.2.19-0ubuntu0.18.04.2.
 [PASS] PCRE compiled with unicode support.
 [FAIL] The temporary directory and its content are not writable.
  [HELP] Ensure the temporary directory and its content are writable by the webserver user.
  [HELP] you can try:
  [HELP] sudo chown -R www-data:www-data /var/www/passbolt/tmp/
  [HELP] sudo chmod 775 $(find /var/www/passbolt/tmp/ -type d)
  [HELP] sudo chmod 664 $(find /var/www/passbolt/tmp/ -type f)
 [PASS] The public image directory and its content are writable.
 [PASS] The logs directory and its content are writable.
 [PASS] GD or Imagick extension is installed.
 [PASS] Intl extension is installed.
 [PASS] Mbstring extension is installed.

 Config files

 [PASS] The application config file is present
 [PASS] The passbolt config file is present

 Core config

 [PASS] Debug mode is off.
 [PASS] Cache is working.
 [PASS] Unique value set for security.salt
 [PASS] Full base url is set to https://passbolt.[domain.com]
 [PASS] App.fullBaseUrl validation OK.
 [PASS] /healthcheck/status is reachable.

 SSL Certificate

 [FAIL] SSL peer certificate does not validate
 [FAIL] Hostname does not match when validating certificates.
 [WARN] Using a self-signed certificate
  [HELP] fopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
fopen(): Failed to enable crypto
fopen(https://passbolt.[domain.com]/healthcheck/status.json): failed to open stream: operation failed

 Database

 [PASS] The application is able to connect to the database
 [PASS] 26 tables found
 [PASS] Some default content is present
 [FAIL] The database schema is not up to date.
  [HELP] Run the migration scripts:
  [HELP] sudo su -s /bin/bash -c "/var/www/passbolt/bin/cake migrations migrate --no-lock" www-data
  [HELP] See. https://www.passbolt.com/help/tech/update

 GPG Configuration

 [PASS] PHP GPG Module is installed and loaded.
 [PASS] The environment variable GNUPGHOME is set to /home/www-data/.gnupg.
 [PASS] The directory /home/www-data/.gnupg containing the keyring is writable by the webserver user.
 [PASS] The server gpg key is not the default one
 [PASS] The public key file is defined in config/passbolt.php and readable.
 [PASS] The private key file is defined in config/passbolt.php and readable.
 [PASS] The server key fingerprint matches the one defined in config/passbolt.php.
 [FAIL] The server public key defined in the config/passbolt.php (or environment variables) is not in the keyring
  [HELP] Import the private server key in the keyring of the webserver user.
  [HELP] you can try:
  [HELP] sudo su -s /bin/bash -c "gpg --home /home/www-data/.gnupg --import /var/www/passbolt/config//gpg/serverkey_private.asc" www-data
 [PASS] There is a valid email id defined for the server key.

 Application configuration

 [PASS] Using latest passbolt version (2.11.0).
 [PASS] Passbolt is configured to force SSL use.
 [PASS] App.fullBaseUrl is set to HTTPS.
 [PASS] Selenium API endpoints are disabled.
 [PASS] Search engine robots are told not to index content.
 [WARN] Registration is open to everyone.
  [HELP] Make sure this instance is not publicly available on the internet.
  [HELP] Or set passbolt.registration.public to false in config/passbolt.php.
 [PASS] Serving the compiled version of the javascript app
 [PASS] All email notifications will be sent.

Running ./cake passbolt migrate:

ubuntu@passbolt:/var/www/passbolt/bin$ sudo -u www-data ./cake passbolt migrate


     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
---------------------------------------------------------------
 Running migration scripts.
---------------------------------------------------------------
using migration paths
 - /var/www/passbolt/config/Migrations
using seed paths
 - /var/www/passbolt/config/Seeds
using environment default
using adapter mysql
using database passbolt

 == 20190112124290 V270AddActionsTable: migrating
PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'actions' already exists in /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Ada
pter/PdoAdapter.php:167
Stack trace:
#0 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(167): PDO->exec('CREATE TABLE `a...')
#1 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php(299): Phinx\Db\Adapter\PdoAdapter->execute('CREATE TABLE `a...')
#2 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(369): Phinx\Db\Adapter\MysqlAdapter->createTable(Object(Phinx\Db\Table\Table),
 Array, Array)
#3 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(138): Phinx\Db\Adapter\AdapterWrapper->createTable(Object(Phinx\Db\Table\T
able), Array, Array)
#4 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(369): Phinx\Db\Adapter\TimedOutputAdapter->createTable(Object(Phinx\Db\Table\T
able), Array, Array)
#5 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(140): Phinx\Db\Adapter\AdapterWrapper->createTable(Object(Phinx\Db\Table\Table), Array, Arr
ay)
#6 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(719): Phinx\Db\Plan\Plan->execute(Object(Migrations\CakeAdapter))
#7 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(613): Phinx\Db\Table->executeActions(false)
#8 /var/www/passbolt/vendor/cakephp/migrations/src/Table.php(118): Phinx\Db\Table->create()
#9 /var/www/passbolt/config/Migrations/20190112124290_V270AddActionsTable.php(47): Migrations\Table->create()
#10 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(128): V270AddActionsTable->up()
#11 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(391): Phinx\Migration\Manager\Environment->executeMigration(Object(V270AddActionsTabl
e), 'up', false)
#12 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(365): Phinx\Migration\Manager->executeMigration('default', Object(V270AddActionsTable
), 'up', false)
#13 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate('default', 20190623143400, false)
#14 /var/www/passbolt/vendor/cakephp/migrations/src/Command/CommandTrait.php(35): Phinx\Console\Command\Migrate->execute(Object(Symfony\Component\Console\Input\Ar
gvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/passbolt/vendor/cakephp/migrations/src/Command/Migrate.php(67): Migrations\Command\Migrate->parentExecute(Object(Symfony\Component\Console\Input\Argv
Input), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/passbolt/vendor/symfony/console/Command/Command.php(255): Migrations\Command\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Obje
ct(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/passbolt/vendor/symfony/console/Application.php(969): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput
), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/passbolt/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Migrations\Command\Migrate), Object(
Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/passbolt/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput),
 Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/passbolt/vendor/cakephp/migrations/src/Shell/MigrationsShell.php(109): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\In
put\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/Shell.php(532): Migrations\Shell\MigrationsShell->main('migrations', 'migrate')
#22 /var/www/passbolt/vendor/cakephp/migrations/src/Shell/MigrationsShell.php(165): Cake\Console\Shell->runCommand(Array, true, Array)
#23 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(230): Migrations\Shell\MigrationsShell->runCommand(Array, true, Array)
#24 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(182): Cake\Console\ShellDispatcher->_dispatch(Array)
#25 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/Shell.php(419): Cake\Console\ShellDispatcher->dispatch(Array)
#26 /var/www/passbolt/src/Shell/Task/MigrateTask.php(69): Cake\Console\Shell->dispatchShell('migrations migr...')
#27 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/Shell.php(532): App\Shell\Task\MigrateTask->main()
#28 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/Shell.php(525): Cake\Console\Shell->runCommand(Array, false, Array)
#29 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(384): Cake\Console\Shell->runCommand(Array, true)
#30 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(162): Cake\Console\CommandRunner->runShell(Object(App\Shell\PassboltShell), Array)
#31 /var/www/passbolt/bin/cake.php(10): Cake\Console\CommandRunner->run(Array)
#32 {main}
Cleared default cache
Cleared _cake_core_ cache
Cleared _cake_model_ cache

was looking at my previous issues
https://community.passbolt.com/t/trouble-restoring-backup/1405/4
doing a recovery seemed to fix it
:man_facepalming:
(sorry)

Still getting database migration issues though, so would be nice to fix that, along with the other healthchecks

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.