~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to docs/clients/drizzledump.rst

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Drizzledump Backup Tool
 
2
=======================
 
3
 
 
4
Synopsis
 
5
--------
 
6
 
 
7
**drizzledump** [*OPTIONS*] *database* [*tables*]
 
8
 
 
9
**drizzledump** [*OPTIONS*] *--databases* [*OPTIONS*] *DB1* [*DB2* *DB3*...]
 
10
 
 
11
**drizzledump** [*OPTIONS*] *--all-databases* [*OPTIONS*]
 
12
 
 
13
Description
 
14
-----------
 
15
 
 
16
:program:`drizzledump` is used for backing up and
 
17
restoring logical backups of a Drizzle database, as well as for migrating
 
18
from *MySQL*. 
 
19
 
 
20
When connecting to a Drizzle server it will do a plain dump of the server.  It
 
21
will, however, automatically detect when it is connected to a *MySQL* server and
 
22
will convert the tables and data into a Drizzle compatible format.
 
23
 
 
24
Any binary data in tables will be converted into hexadecimal output so that it
 
25
does not corrupt the dump file.
 
26
 
 
27
Drizzledump options
 
28
-------------------
 
29
 
 
30
The :program:`drizzledump` tool has several available options:
 
31
 
 
32
.. option:: -A, --all-databases
 
33
   
 
34
   Dumps all databases found on the server apart from *information_schema* and
 
35
   *data_dictionary* in Drizzle and *information_schema*, *performance_schema*
 
36
   and *mysql* in MySQL.
 
37
 
 
38
.. option:: -c, --complete-insert
 
39
 
 
40
   Dumps using complete insert statements. *CURRENTLY BROKEN*
 
41
 
 
42
.. option:: -C, --compress
 
43
 
 
44
   Use client/server compression protocol.
 
45
 
 
46
.. option:: -F, --flush-logs
 
47
 
 
48
   Flush the server logs before commencing with the dump. *CURRENTLY_BROKEN*
 
49
 
 
50
.. option:: -f, --force
 
51
 
 
52
   Continue even if we get an sql-error. *CURRENTLY_BROKEN*
 
53
 
 
54
.. option:: -?, --help
 
55
 
 
56
   Show a message with all the available options.
 
57
 
 
58
.. option:: -x, --lock-all-tables
 
59
 
 
60
   Locks all the tables for all databases with a global read lock.  The lock is
 
61
   released automatically when :program:`drizzledump` ends.
 
62
   Turns on :option:`--single-transaction` and :option:`--lock-tables`.
 
63
 
 
64
.. option:: --single-transaction
 
65
 
 
66
   Creates a consistent snapshot by dumping the tables in a single transaction.
 
67
   During the snapshot no other connected client should use any of the
 
68
   following as this will implicitly commit the transaction and prevent the
 
69
   consistency::
 
70
 
 
71
      ALTER TABLE
 
72
      DROP TABLE
 
73
      RENAME TABLE
 
74
      TRUNCATE TABLE
 
75
 
 
76
   Only works with InnoDB.  Automatically disables :option:`--lock-tables`.
 
77
 
 
78
.. option:: --disable-opt
 
79
 
 
80
   A shortcut for :option:`--skip-drop-table`, :option:`--skip-locks`,
 
81
   :option:`--skip-create`, :option:`--slow`, :option:`--skip-extended-insert`
 
82
   and :option:`--skip-disable-keys`
 
83
 
 
84
.. option:: --tables t1 t2 ...
 
85
 
 
86
   Dump a list of tables.
 
87
 
 
88
.. option:: --show-progress-size rows (=10000)
 
89
 
 
90
   Show progress of the dump every *rows* of the dump.  Requires
 
91
   :option:`--verbose`
 
92
 
 
93
.. option:: -v, --verbose
 
94
 
 
95
   Sends various verbose information to stderr as the dump progresses.
 
96
 
 
97
.. option:: --skip-create
 
98
 
 
99
   Do not dump the CREATE TABLE / CREATE DATABASE statements.
 
100
 
 
101
.. option:: --skip-extended-insert
 
102
 
 
103
   Dump every row on an individual line.  For example::
 
104
 
 
105
     INSERT INTO `t1` VALUES (1,'hello');
 
106
     INSERT INTO `t1` VALUES (2,'world');
 
107
 
 
108
.. option:: --skip-dump-date
 
109
 
 
110
   Do not display the date/time at the end of the dump.
 
111
 
 
112
.. option:: --no-defaults
 
113
 
 
114
   Do not attempt to read configuration from configuration files.
 
115
 
 
116
.. option:: --add-drop-database
 
117
 
 
118
   Add `DROP DATABASE` statements before `CREATE DATABASE`.
 
119
 
 
120
.. option:: --compact
 
121
 
 
122
   Gives a more compact output by disabling header/footer comments and enabling
 
123
   :option:`--skip-add-drop-table`, :option:`--no-set-names`,
 
124
   :option:`--skip-disable-keys` and :option:`--skip-add-locks`.
 
125
 
 
126
.. option:: -B, --databases
 
127
 
 
128
   Dump several databases.  The databases do not need to follow on after this
 
129
   option, they can be anywhere in the command line.
 
130
 
 
131
.. option:: --insert-ignore
 
132
 
 
133
   Add the `IGNORE` keyword into every `INSERT` statement.
 
134
 
 
135
.. option:: --no-autocommit
 
136
 
 
137
   Make the dump of each table a single transaction by wrapping it in `COMMIT`
 
138
   statements.
 
139
 
 
140
.. option:: -n, --no-create-db
 
141
 
 
142
   Do not output the `CREATE DATABASE` statements when using
 
143
   :option:`--all-databases` or :option:`--databases`.
 
144
 
 
145
.. option:: -d, --no-data
 
146
 
 
147
   Do not dump the data itself, used to dump the schemas only.
 
148
 
 
149
.. option:: --slow
 
150
 
 
151
   Dump directly from database to destination rather than using a query buffer.
 
152
 
 
153
.. option:: --replace
 
154
 
 
155
   Use `REPLACE INTO` statements instead of `INSERT INTO`
 
156
 
 
157
.. option:: --destination-type type (=stdout)
 
158
 
 
159
   Destination of the data.
 
160
 
 
161
   **stdout**
 
162
      The default.  Output to the command line
 
163
 
 
164
   **database**
 
165
      Connect to another database and pipe data to that.
 
166
 
 
167
   .. versionadded:: 2010-09-27
 
168
 
 
169
.. option:: --destination-host hostname (=localhost)
 
170
 
 
171
   The hostname for the destination database.  Requires
 
172
   :option:`--destination-type` `= database`
 
173
 
 
174
   .. versionadded:: 2010-09-27
 
175
 
 
176
.. option:: --destination-port port (=3306)
 
177
 
 
178
   The port number for the destination database.  Requires
 
179
   :option:`--destination-type` `= database`
 
180
 
 
181
  .. versionadded:: 2010-09-27
 
182
 
 
183
.. option:: --destination-user username
 
184
 
 
185
   The username for the destinations database.  Requires
 
186
   :option:`--destination-type` `= database`
 
187
 
 
188
  .. versionadded:: 2010-09-27
 
189
 
 
190
.. option:: --destination-password password
 
191
 
 
192
   The password for the destination database.  Requires
 
193
   :option:`--destination-type` `= database`
 
194
 
 
195
  .. versionadded:: 2010-09-27
 
196
 
 
197
.. option:: --destination-database database
 
198
 
 
199
   The database for the destination database, for use when only dumping a
 
200
   single database.  Requires
 
201
   :option:`--destination-type` `= database`
 
202
 
 
203
  .. versionadded:: 2010-09-27
 
204
 
 
205
.. option:: -h, --host hostname (=localhost)
 
206
 
 
207
   The hostname of the database server.
 
208
 
 
209
.. option:: -u, --user username
 
210
 
 
211
   The username for the database server.
 
212
 
 
213
.. option:: -P, --password password
 
214
 
 
215
   The password for the database server.
 
216
 
 
217
.. option:: -p, --port port (=3306,4427)
 
218
 
 
219
   The port number of the database server.  Defaults to 3306 for MySQL protocol
 
220
   and 4427 for Drizzle protocol.
 
221
 
 
222
.. option:: --protocol protocol (=mysql)
 
223
 
 
224
   The protocol to use when connecting to the database server.  Options are:
 
225
 
 
226
   **mysql**
 
227
      The standard MySQL protocol.
 
228
 
 
229
   **drizzle**
 
230
      The Drizzle protocol.
 
231
 
 
232
Backups using Drizzledump
 
233
-------------------------
 
234
 
 
235
Backups of a database can be made very simply by running the following::
 
236
 
 
237
     $ drizzledump --all-databases > dumpfile.sql
 
238
 
 
239
This can then be re-imported into drizzle at a later date using::
 
240
 
 
241
     $ drizzle < dumpfile.sql
 
242
 
 
243
MySQL Migration using Drizzledump
 
244
---------------------------------
 
245
 
 
246
As of version 2010-09-27 there is the capability to migrate databases from
 
247
MySQL to Drizzle using :program:`drizzledump`.
 
248
 
 
249
:program:`drizzledump` will automatically detect whether it is talking to a
 
250
MySQL or Drizzle database server.  If it is connected to a MySQL server it will
 
251
automatically convert all the structures and data into a Drizzle compatible 
 
252
format.
 
253
 
 
254
So, simply connecting to a MySQL server with :program:`drizzledump` as follows
 
255
will give you a Drizzle compatible output::
 
256
 
 
257
     $ drizzledump --all-databases --host=mysql-host --user=mysql-user --password > dumpfile.sql
 
258
 
 
259
Additionally :program:`drizzledump` can now dump from MySQL and import directly
 
260
into a Drizzle server as follows::
 
261
 
 
262
     $ drizzledump --all-databases --host=mysql-host --user=mysql-user --password --destination-type=database --desination-host=drizzle-host