Transfer local folder cqrlog database to mariadb local server

4 posts / 0 new
Last post
F8EHJ
Transfer local folder cqrlog database to mariadb local server

Hello,

How to move all data from local database saved in ./config/cqrlog to a new computer by using local mariadb server.

I created with success a local mariadb server with empty log but I would like to retrieve all data from my previous log in an old PC.

I know I could import ADIF file but I am afraid to loose call information, station profiles,..

Any help will be appreciated.

Best 73's

Hervé F8EHJ

oh1kh
Transfer local folder cqrlog database to mariadb local server

Hi Hervé !

You could try script from this zip.
https://github.com/OH1KH/CqrlogAlpha/blob/main/compiled/move_logs_from_l...

It makes common mysqldump form all logs and separate dumps from every log.
You can then "restore" result to server from command line

--
Saku
OH1KH

F8EHJ
thanks saku,

thanks saku,

Seems the script file into zip is to backup all data from already local mariadB server.
Anyway, it helps me to move data from file local database to localhost mariadb server.

Here I do :
I launch CQRLOG with local database save on file.
In terminal :
/usr/bin/mysql -B -N --socket ~/.config/cqrlog/database/sock -e'show databases like "cqr%"' | /usr/bin/xargs /bin/echo -n mysqldump --socket ~/.config/database/sock --databases
Shell returns this line in my case : mysqldump --socket /home/f8ehj/.config/cqrlog/database/sock --databases cqrlog001 cqrlog002 cqrlog_common
Write command to save logs into /tmp/mycqrlogs.sql:
mysqldump --socket /home/f8ehj/.config/cqrlog/database/sock --databases cqrlog001 cqrlog002 cqrlog_common >/tmp/mycqrlogs.sql

Remove cqrlog directory from ~/.config
Launch CQRLOG local server to create user cqrlog with password cqrlog
Then, leave cqrlog. In terminal :
mysql -ucqrlog -pcqrlog < /tmp/mycqrlogs.sql

ouch :-( If error :
ERROR : ERROR 1959 (OP000) at line 1901: Invalid role specification
sed '1901;d' mycqrlogs.sql to see the error : DEFINER=`` and found solution in forum post :

solution : replace DEFINER=`` with DEFINER=CURRENT_USER with nano. Be carfeul to use ALTGR+7 for azerty keyboard

Now, try again to restore database in local mariadB server :
mysql -ucqrlog -pcqrlog < /tmp/mycqrlogs.sql

Done !

73's

oh1kh
Transfer local folder cqrlog database to mariadb local server

OK, fine!

Yes the "Definer" problem was forgotten by me.
I think it appears if there is a version difference between local and server MariaDB databases (local created with older version).

I have used the backup script (move script is modification of it) some time ago and I did not notice the definer problem then.

Main thing is that you solved it!

--
Saku
OH1KH