View unanswered posts | View active topics It is currently Sun May 26, 2013 2:24 am



Reply to topic  [ 5 posts ] 
how to backup/restore database? 
Author Message

Joined: Thu Apr 26, 2007 3:35 am
Posts: 146
Post 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.


Mon Mar 07, 2011 1:43 am
Profile

Joined: Wed Dec 02, 2009 10:55 pm
Posts: 557
Location: Spain
Post 
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


Mon Mar 07, 2011 7:26 am
Profile

Joined: Wed Jan 11, 2006 1:19 pm
Posts: 442
Post 
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;

Code:
mysqldump --user=XXXXXXXX --password=XXXXXXX --databases zm > /PATH/TO/DUMPFILE.SQL


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;

Code:
mysql  --user=XXXXXXXX --password=XXXXXXXX zm < /PATH/TO/DUMPFILE.SQL


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.


Mon Mar 07, 2011 7:37 am
Profile

Joined: Thu Apr 26, 2007 3:35 am
Posts: 146
Post 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. :)


Wed Mar 09, 2011 3:21 am
Profile

Joined: Thu Apr 26, 2007 3:35 am
Posts: 146
Post got it
No password for MySQL by default. :)


Sat Mar 12, 2011 12:27 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group