Restore Mysql from backup


Does anyone have any instructions on how to manually restore the mysql db from a backup file?

They used to have a mysql file, but that has changed.


(Dave Burgess) #2

There’s not nearly enough detail in your question for us to help you.

You say you have a back up file. Where’d you get it?
Why do you want to manually update the database?
You had a mysql file but now you don’t. What do you mean?
Are you trying to restore a file from the backup module?


The backup file was obtained via the FreePBX backup module.

I want to manually fix the db because it has crashed. I was getting the sock error but no sock file existed.

The old version of how backups were created generated a mysql file inside of the tar file. The new versions of backups do not. The data is stored in a different format that I am unfamiliar with, so I have no idea how to rebuild the db off the backups.

I cannot restore via the backup module because mysql is required for the GUI. I cannot restore via the backup module in the terminal because it requires fwconsole, which requires mysql.

I can burn the server to the ground, reinstall freepbx 15, and rebuild from the backup.

All I ran was a “shutdown -r now” command. That should have been a safe shutdown for mysql, unless I’m missing something.

(Simon Telephonics) #4

Are you sure the database is ruined? It sounds like mysql server won’t start, which you can probably fix without rebuilding the whole database.

(Jared Busch) #5

Because modules are saved as individual json files now. Much better for the more flexible backup method.

The only database dumps now are the CDR/CEL and apparantly SangomaConnect & Zulu.

The dump location is still there though, just empty.

(Jared Busch) #6

Right. Fix mariadb and restore again.

If you cannot easily fix, or do not know how, then just burn it down and reinstall from scratch, it should only take 10 minutes or so.

If the restore causes the same thing again, open a bug report and keep the backup file. One of the devs will want to get a copy of it for replication testing.


Some findings:

MariaDB refuses to stop and gets killed off by the kernel after 5 minutes causing InnoDB corruption. This has been occurring on Cloud VMs specifically.

(system) closed #8

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