Hi,
after struggling to upgrade my Debian installation from Wheezy to Jessie prior to upgrade ZM from 1.28 to 1.29 I decided to start with a fresh Ubuntu Trusty / ZM 1.29 installation. Having a carefully tuned ZM installation up and running I would like to migrate the database / settings from the old installation. I thought about the following steps:
1. dump database (mysqldump)
2. transfer dump to new server
3. import database
4. run zmupdate.pl
Could somebody please confirm that this is - basically - the way to go?
Any hint apprechiated.
Regrds,
Mark
Migrate ZM installation
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Migrate ZM installation
5. Examine Options -> Paths and verify every value shown is appropriate for Ubuntu Trusty, particularly PATH_ZMS (see "easy way" documentation)
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Migrate ZM installation
That is what I did but from Ubuntu 14.04 to Centos 7. After you run the database upgrade make sure you do the permissions for MySQL. See the WIKI for instructions.
bb
bb
Re: Migrate ZM installation
Thanks so far!
Regarding step 3 (import database):
I dumped the database (mysqldump -u root -p zm > zm.sql) on the old system and installed LAMP and ZM on the new system. According to the documentation the next step would be to create the database and 'zmuser':
My approach would be to skip both steps and import the old database instead:
Will this do the trick?
Rgrds,
Mark
Regarding step 3 (import database):
I dumped the database (mysqldump -u root -p zm > zm.sql) on the old system and installed LAMP and ZM on the new system. According to the documentation the next step would be to create the database and 'zmuser':
Code: Select all
sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Code: Select all
mysql -uroot -p zm < /path/to/zm.sql
Rgrds,
Mark
Re: Migrate ZM installation
Looks right if you are sure of your commands. I have to admit that I used Webmin to import the zm dump of the old installation. I created an empty database called zm then ran the sql dump file, went to a command prompt and ran the zm upgrade and then the permissions string. Make sure you have added innodb_file_per_table to my.cnf then restart MySQL before you add your zm database.
Re: Migrate ZM installation
@bbunge & knnniggett,
many thanks for your recommendations. ZM runs like a charm again. Regarding the database migration I used the following steps:
Dump database on old system: mysqldump -u root -p zm > zm.sql
Create db on new system: mysql -uroot -p -e "CREATE DATABASE zm;"
(Create 'zmuser' according to wiki & docs.)
Import db from old system: mysql -uroot -p zm < /mnt/zm.sql
Update db: zmupdate.pl (without any options)
Pretty easy!
Rgrds,
Mark
many thanks for your recommendations. ZM runs like a charm again. Regarding the database migration I used the following steps:
Dump database on old system: mysqldump -u root -p zm > zm.sql
Create db on new system: mysql -uroot -p -e "CREATE DATABASE zm;"
(Create 'zmuser' according to wiki & docs.)
Import db from old system: mysql -uroot -p zm < /mnt/zm.sql
Update db: zmupdate.pl (without any options)
Pretty easy!
Rgrds,
Mark
Re: Migrate ZM installation
But... did you do:
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
Re: Migrate ZM installation
Yes, I did this right after I imported the db. I skiped this step in the list above because it is not specific with respect to the migration of the db. But it is a good idea to make this clear.
Greetings
Mark
Greetings
Mark