Upgrade v12 to v15

I’ve worked for my company for 15 years, and leaving at the end of this month. Installed FreePBX v12 6 years ago and it has been running that way ever since, and rock solid. As part of my departure I am going to upgrade to new hardware and to v15 so that it can be managed by Sangoma if/when they need it. I installed v15 on a VM so I can test things out. When restoring from command line (fwconsole backup --restore 20210125-000001-1611558001-330275130.tgz) I get an error when processing the sql file, but it’s so generic that I can’t tell where in the file it’s getting the error.

Detected file /tmp/backup/d7f5ff9b-68cd-45d2-8937-50e99b6f2d6f/mysql-3.sql as the PBX (Asterisk) database. Attempting restore
Loading supplied database file mysql-3
SQLSTATE[HY000]: General error: 1 near “)”: syntax error

Ok, fine, the error is obviously with mysql-3.sql, so I try doing a manual restore with mysql of mysql-3.sql. Well, there are some errors related to foreign keys and the order of tables in the file due to the way it was dumped. So I use mysqldump to get the asterisk db from the production system and test restore with mysql. Works perfect. I remake the tar file and run it again. Same error. What the hell?

[root@freepbx bak]# fwconsole backup --restore backup.tar
Transaction ID is: a6ee9eb0-b04c-40aa-80da-9a3e4b28ea3e
Determining backup file type…type is legacy
Legacy CDR Restore Option: 0
Starting restore job with file: backup.tar
Extracting backup…
Loading manifest to memory
Parsing out SQL tables. This may take a moment depending on backup size.
Found 2 database files in the backup.
File named: /tmp/backup/a6ee9eb0-b04c-40aa-80da-9a3e4b28ea3e/mysql-3.sql
Detected file /tmp/backup/a6ee9eb0-b04c-40aa-80da-9a3e4b28ea3e/mysql-3.sql as the PBX (Asterisk) database. Attempting restore
Loading supplied database file mysql-3
SQLSTATE[HY000]: General error: 1 near “)”: syntax error

Backup module ver on new pbx?

fwconsole ma list | grep backup

Interesting

| backup | 12.0.19 | Disabled; Pending upgrade to 15.0.10.43 | GPLv3+ |

Did I maybe mess this up by manually restoring the entire sql file? Does the backup restore do something more selective about what it restores?

The restore module in 15 is not just blindly restoring SQL files as was done in the past. It’s extracting relevant details from the legacy tarball and restoring them module by module. Prob best to restore a snapshot from before the manual SQL import.

You can update the backup module to edge using

fwconsole ma upgrade backup --edge

and attempt to restore again. If issue persists, we’re going to need a ticket, which may include securly sharing the tarball you’re using:
https://issues.freepbx.org/

Excellent info. Thank you. I will start over and see how that goes.

1 Like

Started from scratch, fixed sql file, started restore, failed again. Upgraded to edge module, tried again, failed again. Same error.

I’ll open an issue with the original v12 backup.

I ended up hiding the ticket so @rtheil could share their backup securely, but it’s marked as fixed now.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.