From f946e86317bbfb9a6f8a28625fb416ed8064217a Mon Sep 17 00:00:00 2001 From: Thomas Karpiniec Date: Sun, 7 Feb 2016 19:14:48 +1100 Subject: [PATCH] Add instructions for how to restore from backup using suggested method --- html/admin/backup_restore.html | 41 +++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/html/admin/backup_restore.html b/html/admin/backup_restore.html index be9e159..6d9f059 100644 --- a/html/admin/backup_restore.html +++ b/html/admin/backup_restore.html @@ -34,11 +34,46 @@

TIMESTAMP=$(date +%Y%m%d-%H%M)
- mysqldump -u "database_username" -p "database_name" | xz -c - > "~/$TIMESTAMP-$DB_NAME.sql.xz"
- (You will be prompted for a password. Type in the password for the MySQL user.) + mysqldump -u "database_username" -p "database_name" | xz -c - > "~/$TIMESTAMP-social.sql.xz"

+

You will be prompted for a password. Type in the password for the MySQL user.

+ + + {HEADING:SECTION:restore_procedure:Restoring from a Backup} -

TODO

+
    +
  1. Stop the queue daemons if they're running.
  2. +
  3. Restore the web files.
  4. +
  5. Restore the database.
  6. +
  7. Restart the queue daemons.
  8. +
+

If you followed the examples above you might type the following:

+ +
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