Migrating from VitalPBX 4 to 4.5 follows a similar approach to the migration process from version 3 to 4. Below is a detailed guide to help you complete the migration process smoothly.
If you want to do it manually, keep reading the instructions
If you want to do it with a script click here -this second method is using the same server where it is installed on Debian 11, it does not require a new server.
Debian 12 Server Preparation
1. Set up a new server with a fresh installation of Debian 12.
2. Install VitalPBX 4.5 by following the official installation instructions here.
3. Install the same add-ons used on your current production server.
4. Complete the wizard setup for the Sonata and VitXi modules. Use placeholder credentials during the setup; these will be replaced when the backup is restored.
5. If OpenVPN is installed and configured on your existing server, install and configure it on the new Debian 12 server.
Actions on the Debian 11 Server
1. Use the Backup and Restore module in VitalPBX to create a backup of
your settings.
2. For large CDR data and call recordings, transfer these manually (instructions below).
3. Save the backup file to your local machine.
4. Revoke the VitalPBX license(s) from your current production server.
Importing the Backup to VitalPBX 4.5 (Debian 12)
1. Activate the necessary license(s) on the new server.
2. Use the Backup and Restore module to import and restore the backup file.
3. Run the following commands to ensure all settings are applied correctly.
vitalpbx build-db
vitalpbx fully-gen-conf
4. If the CDR and call recordings were migrated manually, execute the
commands above after transferring the data.
Manually Moving Call Recordings and CDR Data
Call Recordings
To transfer call recordings from /var/spool/asterisk/monitor on the Debian
11 server to the same path on the Debian 12 server, run the following rsync command on the Debian 12 server.
rsync -avz root@:/var/spool/asterisk/monitor/
/var/spool/asterisk/monitor/
Replace <Debian11_IP> with the IP address of the Debian 11 server.
CDR Data
To migrate CDR data from the Debian 11 server to the Debian 12 server follow
the steps below.
1. Create a MySQL Backup on the Debian 11 server.
mysqldump -u root --add-drop-table --ignore-table=asterisk.cel
asterisk > cdr_backup.sql
2. Use SCP to transfer the backup file to the Debian 12
scp cdr_backup.sql root@:/root/
3. On the Debian 12 server, restore the database.
mysql -u root asterisk < /root/cdr_backup.sql
Perform post-migration testing here.
Debian Upgrade and Cleanup Script (Including VitalPBX 4 to 4.5 Migration)
This script automates the process of upgrading a Debian 11 system to Debian 12 and includes a seamless migration from VitalPBX 4 to VitalPBX 4.5, along with cleanup tasks to optimize the environment.
This second method is using the same server where it is installed on Debian 11, it does not require a new server.
Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can’t afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system.
How to Use
- Download the script file.
wget https://raw.githubusercontent.com/VitalPBX/VPBX4toVPBX45SS/refs/heads/main/vpbx4tovpbx45.sh
- Make the script executable:
chmod +x vpbx4tovpbx45.sh
- Execute the script:
./vpbx4tovpbx45.sh
- Configuration Prompts During Script Execution
When running the script, you may encounter prompts like the following:
*** mpm_event.conf (Y/I/N/O/D/Z) [default=N] ?
.......
*** firewalld.conf (Y/I/N/O/D/Z) [default=N] ?
- Optional: Remove All Unused Kernels from Version 5.x
dpkg --list | grep 'linux-image-5' | awk '{print $2}' | grep -v "$(uname -r)" | xargs sudo apt remove -y
If you want more information about how the script works, you can go to our GitHub page.
Post-Migration Testing
1. Verify all settings, trunks, extensions, and modules.
2. Test critical features like inbound/outbound calls, voicemail, and call
recordings.
3. Confirm that CDR data and call recordings are accessible and accurate.