How to export FOP2 configuration from one system to another

Howto


Understanding FOP2 Configuration Migration

When migrating FOP2 from one system to another, you generally don’t need to migrate much data. The button layout (devices) loads automatically from the PBX configuration, which should remain the same on both systems. You might only need to migrate users and groups/permissions if you have defined special configurations that differ from the default.

Exporting FOP2 Configuration

In recent versions of FOP2, there’s a convenient script to export your configuration settings. This script captures all the necessary configuration data into a JSON file that can later be imported into the new system.

To export your FOP2 configuration, log into your original server via SSH and run the following command:

php /usr/local/fop2/export_fop2_configs.php >/tmp/fop2_configuration.json

This command will create a file named fop2_configuration.json in the /tmp directory containing all your FOP2 configuration data.

Transferring Configuration to the New Server

After exporting the configuration, you need to transfer the JSON file to the new server. You can use SCP or any other file transfer method. For example, to copy the file using SCP (replace the IP address with your new server’s IP):

scp /tmp/fop2_configuration.json root@10.0.0.1:/tmp

This command copies the configuration file to the /tmp directory on your new server.

Importing FOP2 Configuration

Once the configuration file is on the new server, you can import it using the FOP2 import script. Make sure FOP2 is already installed on the new server before proceeding.

To import the configuration, log into your new server via SSH and run:

php /usr/local/fop2/import_fop2_configs.php /tmp/fop2_configuration.json

This command reads the configuration file and applies all the settings to your new FOP2 installation.

After importing the configuration, you may need to restart the FOP2 service for all changes to take effect. You can do this with the command:

service fop2 restart

Verifying the Migration

After completing the import and restarting the service, verify that all your users, permissions, and special configurations have been successfully transferred by logging into the FOP2 manager interface on the new server. Check that all settings match your original system.