how to backup/restore database?
how to backup/restore database?
I am looking to migrate my ZM setup to a new server (dual 3.0GHz with hyperthreading, as opposed to my current setup of dual 3.0GHz without), and was hoping there was an easy way to backup my database config (including all zones per camera) and then just restore it on the new server. It would be extremely time consuming to try to come up with lining up and tweaking all the zones again to get it to my current layout. I'm not very familiar with MySQL, and wouldn't know the first thing about which tables would be needed for what.
Hi,
Try to install PHPMyadmin. Then select the ZM database and do a backup of the database selecting all the tables and exporting them in SQL format.
After installing the new server, do the opposite, install phpmyadmin, install zoneminder, that will create an empty database. After this, import the stored SQL database to the new system.
Hope it helps,
PacoLM
Try to install PHPMyadmin. Then select the ZM database and do a backup of the database selecting all the tables and exporting them in SQL format.
After installing the new server, do the opposite, install phpmyadmin, install zoneminder, that will create an empty database. After this, import the stored SQL database to the new system.
Hope it helps,
PacoLM
Actually, that is often a lot of faff since phpmyadmin won't accept large incoming files to restore. You can copy the dumpfile locally and import from there, but even then often times out.
If you just want the setup and not the events, then phpmyadmin is handy since you just select all the tables except events (the really large one) and do as PacoLM says.
If copying the lot though;
That creates DUMPFILE.SQL containing everything from zm's database. Copy that file to the new machine with zoneminder already installed (but stopped) and add it to mysql with;
Remember to copy turn off zm before importing the new db, and to copy across all the jpg files (/var/cache/zoneminder by default). If you don't copy across the jpgs, zmaudit will kill all your new events as orphans. (But will keep your events, monitors etc)
Only when both bits are installed can you restart zm and check all is good.
If you just want the setup and not the events, then phpmyadmin is handy since you just select all the tables except events (the really large one) and do as PacoLM says.
If copying the lot though;
Code: Select all
mysqldump --user=XXXXXXXX --password=XXXXXXX --databases zm > /PATH/TO/DUMPFILE.SQL
Code: Select all
mysql --user=XXXXXXXX --password=XXXXXXXX zm < /PATH/TO/DUMPFILE.SQL
Only when both bits are installed can you restart zm and check all is good.
great info
This is great info. I also found this posting, though Ubuntu it should be close:
http://www.zoneminder.com/forums/viewto ... p+database
One problem.....it's been so long since I installed this, I can't remember my password for MySQL. I'm sure it's in a config file somewhere, but I can't figure it out. I don't see it in the config from the UI.
Help.
http://www.zoneminder.com/forums/viewto ... p+database
One problem.....it's been so long since I installed this, I can't remember my password for MySQL. I'm sure it's in a config file somewhere, but I can't figure it out. I don't see it in the config from the UI.
Help.