Standard installation
...
Linux
Passwork Migration

Old Docker migration to new

12min

These instructions are intended for a single Passwork installation and are not suitable for a fault-tolerant solution.

Preparation

Passwork version check

  1. Check the installed version of Passwork — cat /server/sites/prod/app/config/config.php | grep version. If version:
    1. Lower than 0602xx — you must upgrade to the current version.
    2. Lower than 06xxxx — you need to migrate to Passwork 6.

Creating a MongoDB backup

  1. Go to the Passwork directory and create a directory for the files — cd /server/docker-compose/ && mkdir old_docker
  2. Create a MongoDB backup:
    1. Local installation (MongoDB) without authorisation — docker-compose exec -T db sh -c 'mongodump --archive' > "./old_docker/my.dump"
    2. Local installation (MongoDB) with authorisation — docker-compose exec -T db sh -c 'mongodump --archive --authenticationDatabase admin --username=your-admin --password=your-password' > "./old_docker/my.dump"
    3. Installing (MongoDB) on a separate server — docker-compose exec -T db sh -c 'mongodump --host your-host:your-port --archive --authenticationDatabase admin --username=your-admin --password=your-password' > "./old_docker/my.dump"

Copying the config.ini file and the licence key

  1. Create a copy of the configuration file config.inicp /server/sites/prod/app/config/config.ini ./old_docker/
  2. Create a copy of the licence key passwork-*.keyscp /server/sites/prod/app/keys/*.keys ./old_docker/

Copying a certificate

If installing in Docker will use the same domain name and SSL certificate as the previous Passwork installation. SSL certificates must be copied if HTTPS connection is configured — cp -Rf /server/conf/ssl/ ./old_docker/

Installation

Installation of the main components

  1. Install Docker and Docker Compose
  2. Create and navigate to the directory where you plan to deploy the new Passwork Docker assembly.
  3. Stop the old (used) nginx container with the command — docker stop nginx && docker rm nginx

Downloading scripts

  1. Download the installation script — wget https://repos.passwork.pro/repository/docker/passwork_compose_install.sh
  2. Download the migration script — wget https://repos.passwork.pro/repository/docker/migrate.sh
  3. Assign execution rights — chmod +x ./*.sh

Transferring files from the "Preparation" stage

  1. Move the created ./old_docker directory to the directory where the new Docker build is planned to be deployed
  2. The directory should contain the following files:
    1. Configuration file — config.ini
    2. Licence key — passwork-*.keys
    3. MongoDB backup
    4. SSL certificates of Passwork website

Starting the migration process

  1. Run the script with the -md flag — sudo ./passwork_compose_install.sh -md
  2. The installation script will perform a basic installation of the latest version of Passwork available in your licence and automatically run the migration script.

Additional settings after installation

  1. After the scripts are finished, check that the new installation is working properly and make adjustments if necessary — https://docs.passwork.pro/online-installation#cMZWh
  2. To add mail server or LDAPS protocol root certificates to trusted certificates, copy the .pem or .crt root certificates to the ./conf/custom_ca directory and restart the PHP container — docker compose restart passwork_php
  3. To change the SSL certificate used, copy the certificate/certificate chain to ./conf/ssl/fullchain.pem and the private key to ./conf/ssl/privkey.pem and restart the Nginx container — docker compose restart passwork_nginx

Possible problems and solutions

Issue. Error of rights to one or another base when trying to create a full backup:

shell


Solution. Log in to the MongoDB management shell as the current administrator and add the role:

shell