This file is indexed.

/usr/share/doc/refdb/refdb-manual/ch05s09.html is in refdb-doc 1.0.2-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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Backup your data</title><link rel="stylesheet" type="text/css" href="manual.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="RefDB handbook" /><link rel="up" href="ch05.html" title="Chapter 5. refdbd administration" /><link rel="prev" href="ch05s08.html" title="How to run several refdb instances" /><link rel="next" href="pt03.html" title="Part III. User manual" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backup your data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s08.html">Prev</a> </td><th width="60%" align="center">Chapter 5. refdbd administration</th><td width="20%" align="right"> <a accesskey="n" href="pt03.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sect1-backup-data"></a>Backup your data</h2></div></div></div><p>If your database crashes for whatever reasons, the first question you'll hear is: "You've got a backup, don't you?". At this point in your life you shouldn't even think about <span class="emphasis"><em>not</em></span> having a backup.</p><p>There's basically two ways to create a backup of your reference data: Use a risx dump or use a SQL dump. The risx dump is slower but it would allow you to transfer the data to a refdb installation using a different database server. The SQL dump is faster but you're tied to the database server you're using. If you use SQLite as your database backend, you may simply grab copies of the database files. Each database is stored in one file. This file holds all required information and is platform-independent, so it is suitable for backup purposes.</p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Backups are useful only if you create them regularly. You should work out a schedule based on how often the contents of the database change. Think about setting up a <span class="command"><strong>cron</strong></span> job for nightly or weekly snapshots.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idp66769712"></a>Creating a risx dump</h3></div></div></div><p>All you need to do is to retrieve all references and write them to a file in risx format. Use the <span class="command"><strong>getref</strong></span> command in refdbc for this purpose:</p><pre class="screen">
	<code class="prompt">refdbc: </code>
	<strong class="userinput"><code>getref -t risx -s NOHOLES -o all.ris :ID:&gt;0</code></strong>
      </pre><p>The <code class="option">-s NOHOLES</code> option will dump skeleton references for references that you deleted from the database. This simplifies re-creating the same ID values in a new database.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="idp66775104"></a>Creating a SQL dump</h3></div></div></div><p>This is best done with the command line tools shipped with you database server. You should consult the manual of your database server, but the following commands should be all it takes:</p><p>If you run MySQL as your database server, run:</p><pre class="screen">
	<code class="prompt">$ </code>
	<strong class="userinput"><code>mysqldump -u root -p --opt dbname &gt; dbname.dump</code></strong>
      </pre><p>This assumes that "root" is the name of your database administrator account and "dbname" is the name of your database.</p><p>If you run PostgreSQL instead, use this command:</p><pre class="screen">
	<code class="prompt">$ </code>
	<strong class="userinput"><code>pg_dump -u pgsql -C dbname &gt; dbname.dump</code></strong>
      </pre><p>This assumes that "pgsql" is the name of your database administrator account and "dbname" is the name of your database.</p><p>To restore a database from a dump, use the command line clients shipped with your database server. For MySQL, the required sequence is:</p><pre class="screen">
	<code class="prompt">$ </code>
	<strong class="userinput"><code>mysql -u root -p -e "CREATE DATABASE dbname"</code></strong>
      </pre><pre class="screen">
	<code class="prompt">$ </code>
	<strong class="userinput"><code>mysql -u root -p dbname &lt; dbname.dump</code></strong>
      </pre><p>whereas the following would do the trick with PostgreSQL:</p><pre class="screen">
	<code class="prompt">$ </code>
	<strong class="userinput"><code>psql -u pgsql template1 &lt; dbname.dump</code></strong>
      </pre><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>SQL dumps are also well suited to create backups of refdb, the common refdb database.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s08.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pt03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">How to run several refdb instances </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part III. User manual</td></tr></table></div></body></html>