Pages

Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Friday, June 24, 2022

How to transfer users from MySQL 5.5 to MariaDB 10.x

On the old server:

$ mysqldump -u root -pPassWord mysql > mysql.sql
Copy mysql.sql to the new server

add to the beginning of the file the following:

drop database mysql;
create database mysql;
use mysql;
Now run it on the new machine with MariaDB server
$ mysql -u root -p < mysql.sql
Now you need to run a tool called mysql_upgrade to upgrade old imported mysql database (you need to use --force option).
$ mysql_upgrade --force
MariaDB upgrade detected
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.servers                                      OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Upgrading from a version before MariaDB-10.1
Phase 2/7: Installing used storage engines
Checking for tables with unknown storage engine
Phase 3/7: Fixing views from mysql
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
.... [ cut ] ...

Probably you need to run 'flush privileges' on the new server or restart it.

Monday, June 3, 2013

Roundcube missing contacts after changing IP address of the server.

If you have working installation of Roundcube and for some reason change your IP address the result is missing address book entries of all users.

If in the configuration file config/main.inc.php the line:
$rcmail_config['default_host'] = '10.10.200.1';
is changed to some other IP address (for instance 192.168.10.1) the result is missing address book entries.

In fact entries are not missing but Rouncube shows only enties for the users with current 'default_host' IP address. This means that you have two entries for each users with different 'default_host' field. How to fix it?

First delete all newly created entries with the new default_host:
old: 10.10.200.1, new: 192.168.10.1.
# mysql -u roundcubeuser -proundcubepass
mysql> use roundcube
mysql> delete from users where mail_host='192.168.10.1';
Query OK, 60 rows affected (0.07 sec)
Now change all remained entries with the new default_host:
mysql> update users set mail_host='192.168.10.1' where mail_host='10.10.200.1';
Query OK, 105 rows affected (0.08 sec)
Rows matched: 105  Changed: 105  Warnings: 0
Now you have your addressbook back.