Saltar al contenido principal

Migrating from the legacy Docker build (Passwork 6) to the current build and Passwork 7

Backup

  1. Copy the config.ini configuration file (full path /server/sites/prod/app/config/config.ini) to a directory outside /server.
  2. Create a database backup.
cd /server/docker-compose
docker-compose exec -T db sh -c 'mongodump --archive' > "./before65.dump"
  1. If you are using a virtual machine, take a snapshot of it before the update.

Updating to Passwork 6.5

cd /server/sites/prod/
git pull
git checkout v6

Initial data migration in the interface

  1. Open Settings and usersMigration to Passwork 7:
The migration to Passwork 7 section
  1. Start the migration in the Passwork web interface and wait for it to finish:
Starting the migration in the web interface

Preparing to move to the updated Docker build

  1. Create a directory and change into it:
mkdir /server/migr_dir && cd /server/migr_dir
  1. Create a database backup:
cd /server/docker-compose
docker-compose exec -T db sh -c 'mongodump --archive' > "/server/migr_dir/p65.dump"
  1. Convert the version 6 configuration file into a version 7 configuration and a key file:
cd /server/migr_dir
wget https://repos.passwork.pro/repository/linux/scripts/config_convert.sh
chmod +x config_convert.sh
./config_convert.sh -i "/server/sites/prod/app/config/config.ini" -o "./"
rm config_convert.sh

Example of the directory contents after the conversion:

Contents of migr_dir after the conversion
  1. If you use certificates, additionally:
    • Copy the SSL certificate and key: (shopt -s nullglob; cp -f /server/conf/ssl/*.{crt,pem,key} .)
    • Copy the LDAPS CA certificate: (shopt -s nullglob; cp -f /server/conf/php8/*.{crt,pem} .)
aviso

We recommend performing the migration on a new server: it means less downtime, a clean installation, and the ability to roll back.

When migrating on the same server:

  • The current Docker build requires Docker 18.06.0 and docker compose (instead of docker-compose).
  • Choose an installation path outside /server
  • Stop the current installation: cd /server/docker-compose && docker-compose down nginx.

Installing the current Docker build and Passwork 7

  1. Confirm the migration in the Passwork Customer Portal:
Confirming the migration in the Customer Portal
  1. Install the current Docker build without going through the setup wizard — follow the installation instructions up to the "Setup wizard" step.
peligro

Do not open the web interface and do not run the setup. Otherwise the migration will be considered already completed and will not start, so as not to overwrite the data.

  1. Copy config.env and encryption_key from the migr_dir directory into /<passwork>/conf/keys/ of the new installation.
  2. If necessary, copy from migr_dir:
    • The SSL certificate to /<passwork>/conf/ssl/fullchain.pem
    • The SSL key to /<passwork>/conf/ssl/privkey.pem
    • The root certificate for LDAPS to /<passwork>/conf/custom_ca/
  3. Create the /<passwork>/backup directory and move the p65.dump dump into it.
  4. Restore the database from the backup: ./db-restore.sh p65.dump
  5. Apply the changes: docker compose down && docker compose up -d
  6. Wait about a minute for the containers to start completely.
  7. Start the migration:
docker compose exec -T php-fpm sh -c "cd /server/www && yes | php -d memory_limit=-1 bin/console database:v6:migration"
  1. After a successful migration, open /<passwork>/conf/keys/config.env in an editor:
    • Make sure APP_URL contains the final DNS address of the Passwork server.
    • Remove the block that was only used for the migration:
The block to remove from config.env after the migration