Add instructions for how to restore from backup using suggested method

This commit is contained in:
Thomas Karpiniec 2016-02-07 19:14:48 +11:00
parent df561b6882
commit f946e86317

View File

@ -34,11 +34,46 @@
<p>
<tt>TIMESTAMP=$(date +%Y%m%d-%H%M)</tt><br />
<tt>mysqldump -u "database_username" -p "database_name" | xz -c - > "~/$TIMESTAMP-$DB_NAME.sql.xz"</tt><br />
(You will be prompted for a password. Type in the password for the MySQL user.)
<tt>mysqldump -u "database_username" -p "database_name" | xz -c - > "~/$TIMESTAMP-social.sql.xz"</tt>
</p>
<p>You will be prompted for a password. Type in the password for the MySQL user.</p>
{HEADING:SECTION:restore_procedure:Restoring from a Backup}
<p>TODO</p>
<ol>
<li>Stop the queue daemons if they're running.</li>
<li>Restore the web files.</li>
<li>Restore the database.</li>
<li>Restart the queue daemons.</li>
</ol>
<p>If you followed the examples above you might type the following:</p>
<pre>cd /var/www/social
# Stop the daemons
bash ./scripts/stopdaemons.sh
# Delete and restore the web files
rm -r *
cd ..
tar -Jxf ~/20160130-1200-social-www.tar.xz
# Recreate the database (using MySQL root account)
mysqladmin -u root -p drop social
mysqladmin -u root -p create social
mysql -u root -p social
# Inside mysql client
GRANT ALL on social.* TO 'social'@'localhost' IDENTIFIED BY 'the_old_password';
exit
# Restore the database as the GNU social MySQL user
xzcat ~/20160130-1200-social.sql.xz | mysql -u social -p social
# Restart the queue daemons
cd social
bash ./scripts/startdaemons.sh</pre>