<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=software%2FMastodon%2Fadmin%2Fbackups</id>
	<title>software/Mastodon/admin/backups - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=software%2FMastodon%2Fadmin%2Fbackups"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=software/Mastodon/admin/backups&amp;action=history"/>
	<updated>2026-08-12T18:05:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=software/Mastodon/admin/backups&amp;diff=29164&amp;oldid=prev</id>
		<title>Woozle: Woozle moved page Mastodon/admin/backups to software/Mastodon/admin/backups: disambiguate from band (eventually)</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=software/Mastodon/admin/backups&amp;diff=29164&amp;oldid=prev"/>
		<updated>2025-03-12T19:12:42Z</updated>

		<summary type="html">&lt;p&gt;Woozle moved page &lt;a href=&quot;/Mastodon/admin/backups&quot; class=&quot;mw-redirect&quot; title=&quot;Mastodon/admin/backups&quot;&gt;Mastodon/admin/backups&lt;/a&gt; to &lt;a href=&quot;/software/Mastodon/admin/backups&quot; title=&quot;software/Mastodon/admin/backups&quot;&gt;software/Mastodon/admin/backups&lt;/a&gt;: disambiguate from band (eventually)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:12, 12 March 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=software/Mastodon/admin/backups&amp;diff=27638&amp;oldid=prev</id>
		<title>Woozle: Created page with &quot;==About== Backing up a Mastodon instance requires backing up the following: * media files (may be on another server) * database ===Database=== For reasons unknown to humma...&quot;</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=software/Mastodon/admin/backups&amp;diff=27638&amp;oldid=prev"/>
		<updated>2021-12-26T01:05:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==About== Backing up a &lt;a href=&quot;/Mastodon&quot; class=&quot;mw-redirect&quot; title=&quot;Mastodon&quot;&gt;Mastodon&lt;/a&gt; instance requires backing up the following: * media files (may be on another server) * database ===Database=== For reasons unknown to humma...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==About==&lt;br /&gt;
Backing up a [[Mastodon]] instance requires backing up the following:&lt;br /&gt;
* media files (may be on another server)&lt;br /&gt;
* database&lt;br /&gt;
===Database===&lt;br /&gt;
For reasons unknown to hummankind, Mastodon is hard-wired to use [[PostgreSQL]] for its main database engine, despite the fact that Mastodon uses [[Ruby on Rails]] which provides a database-agnostic framework. The most obvious way to back up Mastodon&amp;#039;s data is to use the &amp;lt;code&amp;gt;pg_dump&amp;lt;/code&amp;gt; client utility, preferably running on the machine where the backup data will be stored.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
* Get the PostgreSQL connection credentials. These should be in &amp;lt;code&amp;gt;{{arg|public html}}/.env.production&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;DB_*&amp;lt;/code&amp;gt; settings).&lt;br /&gt;
* If the PostgreSQL server is directly accessible:&lt;br /&gt;
** Create the &amp;lt;code&amp;gt;~/.pgpass&amp;lt;/code&amp;gt; file (or modify it) so it has the password for the user you want to connect as. Details are [https://www.postgresql.org/docs/9.3/libpq-pgpass.html here].&lt;br /&gt;
** [{{hilite|NOT TESTED}}] From the backup target machine, run: &amp;lt;code&amp;gt;pg_dump -U {{arg|DB_USER}} -h {{arg|host}} -p {{arg|DB_PORT}} {{arg|DB_NAME}} &amp;amp;gt; {{arg|output_filename}}&amp;lt;/code&amp;gt;&lt;br /&gt;
* If it&amp;#039;s not directly accessible, you&amp;#039;ll have to tunnel via ssh and I haven&amp;#039;t worked out how to do that via CLI.&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>