Zum Hauptinhalt springen

Cross-platform migration to Passwork 7

If the current server runs a legacy OS without PHP 8.3 support, a full Passwork update on that OS is not possible. Instead of moving the entire old installation, we recommend a cross-platform migration:

  1. On the new OS, perform a manual installation of Passwork 7.
  2. Data is transferred from the server where Passwork 6.5 remains.
  3. Passwork 7 connects to MongoDB on the legacy OS, reads the database objects, and updates them into a new local database on the current OS.
info

This guide is intended for a manual installation of Passwork.

Actions on the current OS with Passwork

Update and initial migration

  1. Update Passwork to version 6.5.
  2. Perform the initial data migration.

Open access to the MongoDB database

Edit the MongoDB configuration file /etc/mongod.conf and change bindIp from 127.0.0.1 to 0.0.0.0:

net:
bindIp: 0.0.0.0

Restart the MongoDB service:

systemctl restart mongod.service

Generate configuration files for Passwork 7

Create a temporary directory and copy the Passwork configuration file:

mkdir /tmp/pwk_migrate
cp /var/www/app/config/config.ini /tmp/pwk_migrate

Download the conversion script, set permissions, and run it:

cd /tmp/pwk_migrate/
wget https://repos.passwork.pro/repository/linux/scripts/config_convert.sh
chmod +x config_convert.sh
./config_convert.sh --input ./config.ini --output ./

After it finishes, the directory contains two configuration files:

  • config.env
  • encryption_key

Confirm the migration on the Customer Portal

Confirm the data migration on the Passwork Customer Portal. Migration confirmation.

Actions on the new OS

Install Passwork 7

Perform a manual installation of Passwork (the latest available version).

gefahr

After installing Passwork on the new OS, do not open the web interface. Otherwise it will be impossible to complete the Passwork migration correctly.

Transfer and configure the configuration files

  1. Copy the config.env and encryption_key files from /tmp/pwk_migrate/ on the legacy OS to /var/www/init/ on the new OS.
  2. In /var/www/init/config.env, set the MongoDB address of the legacy OS in MIGRATION_DATABASE_URL, and keep MONGODB_URL local:
MONGODB_URL=mongodb://127.0.0.1:27017
MIGRATION_DATABASE_URL=mongodb://192.168.1.100:27017
info

Replace 192.168.1.100 with the IP or hostname of the server with the legacy OS. For the local database on the new OS, mongodb://127.0.0.1:27017 or mongodb://localhost:27017 are valid.

  1. Set the owner of the files in /var/www/init/ to the web server user:
chown www-data:www-data /var/www/init/*

Start the database objects migration

Start transferring objects from MongoDB on the legacy OS to the local MongoDB on the new OS:

sudo -u www-data bash -c 'cd /var/www && yes | php -d memory_limit=-1 ./bin/console database:v6:migration'

For details, see Migration of Passwork database objects.

Completing the migration with client-side encryption

If Passwork uses client-side encryption, complete the final stage — Data migration in the Passwork web interface.

Post-migration actions

After the migration is finished, follow the post-migration actions.