/usr/share/doc/monotone/html/Migrating-and-Dumping.html is in monotone-doc 1.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | <html lang="en">
<head>
<title>Migrating and Dumping - monotone documentation</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="monotone documentation">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Advanced-Uses.html#Advanced-Uses" title="Advanced Uses">
<link rel="prev" href="File-Attributes.html#File-Attributes" title="File Attributes">
<link rel="next" href="Importing-from-CVS.html#Importing-from-CVS" title="Importing from CVS">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body>
<div class="node">
<a name="Migrating-and-Dumping"></a>
<p>
Next: <a rel="next" accesskey="n" href="Importing-from-CVS.html#Importing-from-CVS">Importing from CVS</a>,
Previous: <a rel="previous" accesskey="p" href="File-Attributes.html#File-Attributes">File Attributes</a>,
Up: <a rel="up" accesskey="u" href="Advanced-Uses.html#Advanced-Uses">Advanced Uses</a>
<hr>
</div>
<h3 class="section">3.15 Migrating and Dumping</h3>
<p>While the state of your database is logically captured in terms of a
packet stream, it is sometimes necessary or desirable (especially
while monotone is still in active development) to modify the SQL table
layout or storage parameters of your version database, or to make
backup copies of your database in plain text. These issues are not
properly addressed by generating packet streams: instead, you must use
<dfn>migration</dfn> or <dfn>dumping</dfn> commands.
<p>The <samp><span class="command">mtn db migrate</span></samp> command is used to alter the SQL
schema of a database. The schema of a monotone database is identified
by a special hash of its generating SQL, which is stored in the
database's auxiliary tables. Each version of monotone knows which
schema version it is able to work with, and it will refuse to operate
on databases with different schemas. When you run the
<samp><span class="command">migrate</span></samp> command, monotone looks in an internal list of SQL
logic which can be used to perform in-place upgrades. It applies
entries from this list, in order, attempting to change the database it
<em>has</em> into the database it <em>wants</em>. Each step of this
migration is checked to ensure no errors occurred and the resulting
schema hashes to the intended value. The migration is attempted inside
a transaction, so if it fails — for example if the result of
migration hashes to an unexpected value — the migration is aborted.
<p>If more drastic changes to the underlying database are made, such as
changing the page size of SQLite, or if you simply want to keep a
plain text version of your database on hand, the <samp><span class="command">mtn db
dump</span></samp> command can produce a plain ASCII SQL statement which generates
the state of your database. This dump can later be reloaded using the
<samp><span class="command">mtn db load</span></samp> command.
<p>Note that when reloading a dumped database, the schema of the dumped
database is <em>included</em> in the dump, so you should not try to
<samp><span class="command">init</span></samp> your database before a <samp><span class="command">load</span></samp>.
</body></html>
|