I installed zm on Xubuntu 18.04 with the iconnor ppa. Pretty easy.
Then I wanted to update to Xubuntu 20.04 so put it on another partition. I don't have a lot of cameras but backing up the database and restoring seemed like a good way to get my setups into the new system.
I found this thread: viewtopic.php?t=15294
and did: sudo mysqldump zm > ./zm-dbbackup.sql (later reading seemed to show sudo wasn't needed)
When I tried to restore things hung with no obvious activity or errors. Tried several different strings with and without password but couldn't figure out what the sql password was. I wasn't asked when installing, at least that I recall. Not even sure what the mysql user is.
what user does zm run as?
Need some detailed instructions on this for someone that has done almost nothing with mysql? I have read several pages on it and still not clear. They don't all agree.
mysql backup/restore questions
Re: mysql backup/restore questions
I hope this helps with some of your questions.
These are the commands I use to backup and sometimes restore to the VM version of my ZM. The restore requires an unzip first and the path provided below is incomplete.
I use user root. A lower account may also work. I always run the command as root, but I have not tried lower accounts.
Note the backup command is intended to be run as a cron job and it simply keeps 31 backups. The back up file names only change based on the day of the month. This met my needs and is super simple and does not require a clean-up script.
Backup:
mysqldump -u root -pCoolPassword zm | gzip -9 -f > /zm/store1/dbbackup/zmdb.sql-"`date +"%d"`".gz
Restore:
mysql -u root -pCoolPassword zm < zmdb.sql
These are the commands I use to backup and sometimes restore to the VM version of my ZM. The restore requires an unzip first and the path provided below is incomplete.
I use user root. A lower account may also work. I always run the command as root, but I have not tried lower accounts.
Note the backup command is intended to be run as a cron job and it simply keeps 31 backups. The back up file names only change based on the day of the month. This met my needs and is super simple and does not require a clean-up script.
Backup:
mysqldump -u root -pCoolPassword zm | gzip -9 -f > /zm/store1/dbbackup/zmdb.sql-"`date +"%d"`".gz
Restore:
mysql -u root -pCoolPassword zm < zmdb.sql
Andy
o||||o
Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
o||||o
Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
Re: mysql backup/restore questions
zmuser is the default account used for Mariadb/mysql.
You can always start over, if you have a backup. See: https://wiki.zoneminder.com/MySQL#Recreate_ZM_DB
You can change zmpass / zmuser, but you must also change it in i think /etc/zm/zm.conf and in the API (if you use that).
You can always start over, if you have a backup. See: https://wiki.zoneminder.com/MySQL#Recreate_ZM_DB
Code: Select all
mysql -u root -p -e "drop database zm;"
mysql -u root -p -e "create database zm;"
mysql -u root -p zm < zmdb.sql
mysql -u root -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl
If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl
If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide