~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/clients/drizzledump.rst

  • Committer: Brian Aker
  • Date: 2011-02-17 10:09:00 UTC
  • mfrom: (2173.2.1 clean-include-usuage)
  • Revision ID: brian@tangent.org-20110217100900-4tpuxxzdl1sj00sh
Merge Monty for headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
.. option:: --skip-extended-insert
89
89
 
90
 
Dump every row on an individual line.  For example::
 
90
Dump every row on an individual line.  For example:
 
91
 
 
92
.. code-block:: mysql
91
93
 
92
94
        INSERT INTO `t1` VALUES (1,'hello');
93
95
        INSERT INTO `t1` VALUES (2,'world');
243
245
Backups using Drizzledump
244
246
-------------------------
245
247
 
246
 
Backups of a database can be made very simply by running the following::
247
 
 
248
 
$ drizzledump --all-databases > dumpfile.sql
249
 
 
250
 
This can then be re-imported into drizzle at a later date using::
251
 
 
252
 
$ drizzle < dumpfile.sql
 
248
Backups of a database can be made very simply by running the following:
 
249
 
 
250
.. code-block:: bash
 
251
 
 
252
  $ drizzledump --all-databases > dumpfile.sql
 
253
 
 
254
This can then be re-imported into drizzle at a later date using:
 
255
 
 
256
.. code-block:: bash
 
257
 
 
258
  $ drizzle < dumpfile.sql
253
259
 
254
260
MySQL Migration using Drizzledump
255
261
---------------------------------
260
266
:program:`drizzledump` will automatically detect whether it is talking to a
261
267
MySQL or Drizzle database server.  If it is connected to a MySQL server it will
262
268
automatically convert all the structures and data into a Drizzle compatible 
263
 
format.  It will, however, by default try to connect via. port 4427 so to
264
 
connect to a MySQL server a port must be specified.
 
269
format.
 
270
 
 
271
.. warning::
 
272
 
 
273
   :program:`drizzledump` will by default try to connect via. port 4427 so to
 
274
   connect to a MySQL server a port (such as 3306) must be specified.
265
275
 
266
276
So, simply connecting to a MySQL server with :program:`drizzledump` as follows
267
 
will give you a Drizzle compatible output::
268
 
 
269
 
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
 
277
will give you a Drizzle compatible output:
 
278
 
 
279
.. code-block:: bash
 
280
 
 
281
  $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
270
282
 
271
283
Additionally :program:`drizzledump` can now dump from MySQL and import directly
272
 
into a Drizzle server as follows::
273
 
 
274
 
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
275
 
 
276
 
Please take special note of :ref:`old-passwords-label` if you have connection
277
 
issues from :program:`drizzledump` to your MySQL server.
278
 
 
279
 
If you find your VARCHAR and TEXT data does not look correct in a drizzledump
280
 
output, it is likely that you have UTF8 data stored in a non-UTF8 table.  In
281
 
which case please check the :option:`--my-data-is-mangled` option.
 
284
into a Drizzle server as follows:
 
285
 
 
286
.. code-block:: bash
 
287
 
 
288
  $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
 
289
 
 
290
.. note::
 
291
 
 
292
   Please take special note of :ref:`old-passwords-label` if you have connection
 
293
   issues from :program:`drizzledump` to your MySQL server.
 
294
 
 
295
.. note::
 
296
   If you find your VARCHAR and TEXT data does not look correct in a drizzledump
 
297
   output, it is likely that you have UTF8 data stored in a non-UTF8 table.  In
 
298
   which case please check the :option:`--my-data-is-mangled` option.
282
299
 
283
300
When you migrate from MySQL to Drizzle, the following conversions are required:
284
301
 
294
311
 * tinyblob -> blob
295
312
 * mediumblob -> blob
296
313
 * longblob -> blob
297
 
 * time -> int (of seconds)
298
314
 * year -> int
299
 
 * set -> text
300
 
 * date/datetime default 0000-00-00 -> default NULL (Currently, ALL date columns have their DEFAULT set to NULL on migration)
301
 
 * date/datetime NOT NULL columns -> NULL
302
 
 * any date data containing 0000-00-00 -> NULL
303
 
 * TIME -> INT of the number of seconds*
304
 
 * enum-> DEFAULT NULL
305
 
 
306
 
* This prevents data loss since MySQL's TIME data type has a range of -838:59:59 - 838:59:59, and Drizzle's TIME type has a range of 00:00:00 - 23:59:61.999999.
 
315
 * set -> text [1]_
 
316
 * date/datetime default 0000-00-00 -> default NULL [2]_
 
317
 * date/datetime NOT NULL columns -> NULL [2]_
 
318
 * any date data containing 0000-00-00 -> NULL [2]_
 
319
 * time -> int of the number of seconds [3]_
 
320
 * enum-> DEFAULT NULL [4]_
 
321
 
 
322
.. rubric:: Footnotes
 
323
 
 
324
.. [1] There is currently no good alternative to SET, this is simply to preserve
 
325
       the data in the column.  There is a new alternative to SET to be included
 
326
       at a later date.
 
327
 
 
328
.. [2] Currently, ALL date columns have their DEFAULT set to NULL on migration.
 
329
       This is so that any rows with 0000-00-00 dates can convert to NULL.
 
330
 
 
331
.. [3] This prevents data loss since MySQL's TIME data type has a range of
 
332
       -838:59:59 - 838:59:59, and Drizzle's TIME type has a range of
 
333
       00:00:00 - 23:59:59.
 
334
 
 
335
.. [4] This is so that empty entries such as '' will convert to NULL.