• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Drizzle to MySQL, Stress Free Migration
 

Drizzle to MySQL, Stress Free Migration

on

  • 2,076 views

Talk at the 2011 MySQL Conference and Expo on Drizzle to MySQL migration

Talk at the 2011 MySQL Conference and Expo on Drizzle to MySQL migration

Statistics

Views

Total Views
2,076
Views on SlideShare
2,076
Embed Views
0

Actions

Likes
0
Downloads
13
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Drizzle to MySQL, Stress Free Migration Drizzle to MySQL, Stress Free Migration Presentation Transcript

    • MySQL to Drizzle, stress free migration Andrew Hutchings Software Developer Rackspace [email_address] Http://www.linuxjedi.co.uk/
    • What is Drizzle?
    • KDE3 -> 4
      • New Frameworks
      • Easier for Developers
      • Improved Usability
    • MySQL to Drizzle, stress free migration Picture by K Latham under a CC by NC SA 2.0 license
    • Installing
    • Installing in Ubuntu Natty: sudo apt-get install drizzle Lucid & Maverick: sudo apt-get install python-software-properties sudo apt-add-repository ppa:drizzle-developers/ppa sudo apt-get update sudo apt-get install drizzle (These instructions are also on http://docs.drizzle.org/ )
    • Installing on Fedora Create a /etc/yum.repos.d/drizzle.repo: [drizzle] name=drizzle baseurl=http://rpm.drizzle.org/7-dev/fedora/$releasever/$basearch/ enabled=1 gpgcheck=0 [drizzle-src] name=drizzle-src baseurl=http://rpm.drizzle.org/7-dev/fedora/$releasever/SRPMS enabled=1 Gpgcheck=0 Then: su -c “yum install drizzle7-server drizzle7-client” (These instructions are also on http://docs.drizzle.org/ )
    • Not Supported
    • Not Supported (yet)
      • Stored Procedures
      • Triggers
      • Views
      • SET data type
      • Partitions
    • Not Supported (at all)
      • MyISAM (as a main table)
      • Memory/Heap (as a main table)
      • FULLTEXT indexes
      • DELETE/UPDATE using multiple tables
      • Multiple timezones (only UTC)
      • Cartesian Joins
    • Protocol Picture by Derek Kaczmarczyk under a CC by 2.0 license
    • Protocol Existing Application libmysqlclient Drizzle New Application libdrizzle
    • Settings Picture by Travel Aficionado under a CC by NC 2.0 license
    • Settings
      • Configuration can be multiple files
      • Just use --config-dir=/path/to/files
      • By default no configuration is needed
    • Settings Example config file 1: user=test max-heap-table-size=32M
    • Settings Example config file 2: innodb.buffer-pool-size=256M mysql-protocol.max-connection=2000
    • Settings Example config file 3: [innodb] buffer-pool-size=256M [mysql-protocol] max-connections=32
    • Authentication Auth_all Auth_file Auth_http Auth_ldap Auth_pam Auth plugin system
    • Replication Picture by Kristina Alexanderson under a CC by NC SA 2.0 license
    • MySQL Replication Slave Master Binary Log IO thread SQL thread Transaction InnoDB
    • Drizzle Replication Slave Master InnoDB Replication Reader Replication Applier Transaction
    • Drizzle Replication Start Master: $ drizzled --innodb.replication-log Slave config (slave.cfg): master-host=my_host master-port=3306 master-user=my_user master-password=my_password Start Slave: $ drizzled --plugin-add=slave --slave.config-file=/path/to/slave.cfg
    • Drizzle Replication Disabling replication for a database or table: drizzle> create table t2 (a int) replicate=FALSE; Query OK, 0 rows affected (0.087416 sec) drizzle> create database test2 replicate=FALSE; Query OK, 1 row affected (0.280803 sec)
    • Schemas – Removed Types
      • TINY/SMALL/MEDIUM INT
      • TINY/MEDIUM/LONG BLOB/TEXT
      • YEAR
      • SET
      • CHAR/BINARY
    • Schemas – Changed Types Time In MySQL range is -839:59:59 to 838:59:59 In Drizzle range is 00:00:00 to 23:59:59
    • Schemas – Changed Types Date/Datetime First valid date in MySQL 0000-00-00 First valid date in Drizzle 0001-01-01
    • Schemas – Changed Types INT UNSIGNED UNSIGNED is only a constraint in Drizzle For extended values use BIGINT
    • Schemas – Changed Types INT(n) The braces are not used and ignored.
    • Schemas – New Types TIMESTAMP(6) TIMESTAMP(6) stores microseconds drizzle> select now(); +----------------------------+ | now() | +----------------------------+ | 2011-04-14 00:17:14.638962 | +----------------------------+ 1 row in set (0.000396 sec)
    • Schemas – New Types UUID Stores universally unique values drizzle> select * from t1; +------+--------------------------------------+ | a | b | +------+--------------------------------------+ | 1 | 22681f76-41fa-4245-8461-96dba0961675 | +------+--------------------------------------+ 1 row in set (0.000409 sec)
    • Schemas – New Types BOOLEAN Native BOOLEAN, stores in a single bit where engine supports it. drizzle> select * from t1; +------+------+ | a | b | +------+------+ | 1 | TRUE | +------+------+ 1 row in set (0.000408 sec)
    • Schemas - Strictness
      • Erroneous ENUM actually errors
      • Divide by zero is an error
      • Not NULL actually means Not NULL
    • Character Sets Drizzle supports 2 character sets: UTF-8 and Binary
    • Information Schema Now follows the SQL standard Everything else is in DATA_DICTIONARY
    • Drizzledump Migration Picture by Gianluca Neri under a CC by NC ND 2.0 license
    • Drizzledump Migration History... August 2010 in Seattle, the Developers meeting
    • Drizzledump Migration Database Are you MySQL? Convert Data Output
    • Drizzledump Migration MySQL drizzledump Drizzle stdout
    • Drizzledump Migration
      • MyISAM -> InnoDB
      • FullText Dropped
      • INT UNSIGNED -> BIGINT
      • TINY/SMALL/MEDIUM INT -> INT
      • TINY/MEDIUM/LONG BLOB -> BLOB
      • TINY/MEDIUM/LONG TEXT -> TEXT
      • YEAR -> INT
      • TIME -> INT
    • Drizzledump Migration
      • ENUM has DEFAULT NULL and convert '' to NULL
      • DATE/DATETIME DEFAULT 0000-00-00 -> DEFAULT NULL
      • DATE/DATETIME NOT NULL -> NULL
      • DATE/DATETIME 0000-00-00 data -> NULL
      • SET -> TEXT
    • Drizzledump Migration $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
    • Drizzledump Migration Mysqldump: CREATE TABLE `t1` ( `a` int(11) NOT NULL AUTO_INCREMENT, `b` char(50) DEFAULT NULL, `c` datetime DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `t1` ( `a` INT NOT NULL AUTO_INCREMENT, `b` VARCHAR(50) COLLATE utf8_general_ci DEFAULT NULL, `c` DATETIME DEFAULT NULL, PRIMARY KEY (`a`) ) ENGINE='InnoDB' AUTO_INCREMENT=1 COLLATE='utf8_general_ci'; Drizzledump:
    • Drizzledump Migration INSERT INTO `t1` VALUES (1,'Hello','0000-00-00 00:00:00'), (2,'World','2011-04-14 06:50:52'); INSERT INTO `t1` VALUES (1,'Hello',NULL), (2,'World','2011-04-14 06:50:52'); Mysqldump: Drizzledump:
    • My Data is Mangled! Picture by Remi under a CC by NC ND 2.0 license
    • My Data is Mangled! Whilst migrating... 'è' Became 'è'
    • My Data is Mangled! UTF8 Data PHP App MySQL Server UTF8 Table Drizzledump
    • My Data is Mangled! Solution? --my-data-is-mangled Drizzledump doesn't set MySQL connection character set.
    • Wordpress 3.1 Migration
      • Drizzledump Migration
      • Change 0000-00-00 to 0001-01-01 in code
      Clint Byrum from Canonical is working on a plugin for this
    • The Future
    • Drizzledump From File MySQL Server mysqldump MySQL dump file Drizzledump? Drizzle Server Drizzle dump file
    • MySQL to Drizzle Replication Drizzle Server MySQL Server Binlog Reader Transaction Applier
    • Questions? Photo by Ντάνκαν under CC by NA SA 2.0 license
    • Drizzle Developer Day Friday 15 th April 9:30 – 16:00 Hilton Hotel (across the road) Coastal Ballroom