Follow these step-by-step instructions to seamlessly transfer cPFence to a new server:
Steps to Move cPFence
- Export Backup from the Old Server:
- Run the following command to create a backup of your cPFence settings:
cpfence --backup-cpf-settings
- Use an SFTP client (e.g., Termius) to access both the old and new servers.
- Copy the backup file (
/tmp/cpfence_backup_*.tar.gz
) from the old server to the same location on the new server (/tmp/
).
- Run the following command to create a backup of your cPFence settings:
- Uninstall cPFence from the Old Server:
Run this command to remove cPFence from the old server:
cpfence --uninstall # You can also use this command : /opt/cpfence/app/setup/uninstall
- Reissue the License for the New Server:
Go to your license details page and click Reissue. This step updates your license to work with the new server’s IP.
- Install cPFence on the New Server:
Run the install command provided with your license on the new server to install cPFence, example:
bash <(curl -ks https://api.cpfence.app/install.sh) -k cPFence-XXXXXXXXXXXXXX
- Import Backup to the New Server:
- Ensure the backup file from Step 1 is present in the
/tmp/
directory on the new server. - Restore the backup with this command:
cpfence --restore-cpf-settings
- Ensure the backup file from Step 1 is present in the
Important Note
- Restart cPFence on the new server after importing the backup to apply all settings:
cpfence --restart
- If you encounter any issues, contact our support team for assistance.
By following these steps, you can seamlessly migrate cPFence to a new server without losing your configuration or protection.