Back up the database to a file.
Back up the database to a +file.
Login as root. The following commands will install the export -script:
[joeuser ~]$su -
+script:+[joeuser ~]$su -
[root ~]#cp /var/tmp/export-oracle.txt /usr/sbin/export-oracle
[root ~]#chmod 700 /usr/sbin/export-oracle
Setup the export directory; this is the directory where backups
-will be stored. We recommend the directory /ora8/m02/oracle-exports
.
[root ~]#mkdir /ora8/m02/oracle-exports
+will be stored. We recommend the directory/ora8/m02/oracle-exports
.+[root ~]#@@ -43,7 +46,8 @@ their correct values. If you want to use a directory other thanmkdir /ora8/m02/oracle-exports
[root ~]#chown oracle:dba /ora8/m02/oracle-exports
[root ~]#chmod 770 /ora8/m02/oracle-exports
/ora8/m02/oracle-exports
, you also need to change theexportdir
-setting.Test the export procedure by running the command:
[root ~]#/usr/sbin/export-oracle
+setting.Test the export procedure by running the command:
+[root ~]#+Export terminated successfully without warnings. +/usr/sbin/export-oracle
mv: /ora8/m02/oracle-exports/oraexport-service_name.dmp.gz: No such file or directory Export: Release 8.1.6.1.0 - Production on Sun Jun 11 18:07:45 2000 @@ -78,14 +82,16 @@ . exporting dimensions . exporting post-schema procedural objects and actions . exporting statistics -Export terminated successfully without warnings.
PostgreSQL. Create a backup file and verify that it was created and has a reasonable -size (several megabytes).
[root root]#su - $OPENACS_SERVICE_NAME
+size (several megabytes).+[root root]#su - $OPENACS_SERVICE_NAME
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$pg_dump -f /var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup/before_upgrade_to_4.6.dmp $OPENACS_SERVICE_NAME
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ls -al /var/lib/aolserver/$OPENACS_SERVICE_NAME/database-backup/before_upgrade_to_4.6.dmp
@@ -101,8 +107,8 @@
-Back up the filesystem. Back up all of the
-files in the service, including the database backup file but
+Back up the filesystem. Back up all
+of the files in the service, including the database backup file but
excluding the auto-generated supervise
directory, which is unnecessary and has
complicated permissions.
In the tar command,
@@ -120,16 +126,19 @@ correct extensions.
The last clause, /var/lib/aolserver/$OPENACS_SERVICE_NAME/
,
specifies the starting point for backup. Tar defaults to recursive
backup.
[root root]# su - $OPENACS_SERVICE_NAME
+
+[root root]#+[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ +su - $OPENACS_SERVICE_NAME
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$tar -cpsz --exclude /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/daemontools/supervise \ --file /var/tmp/$OPENACS_SERVICE_NAME-backup.tar.gz /var/lib/aolserver/$OPENACS_SERVICE_NAME/
tar: Removing leading `/' from member names -[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$
Suffer a catastrophic failure on your production -system. (We'll simulate this step)
[root root]#svc -d /service/$OPENACS_SERVICE_NAME
+system. (We'll simulate this step)+[root root]#+[root root]# +svc -d /service/$OPENACS_SERVICE_NAME
[root root]#mv /var/lib/aolserver/$OPENACS_SERVICE_NAME/ /var/lib/aolserver/$OPENACS_SERVICE_NAME.lost
[root root]#rm /service/$OPENACS_SERVICE_NAME
rm: remove symbolic link `/service/$OPENACS_SERVICE_NAME'? y @@ -145,7 +154,8 @@ DROP USER [postgres pgsql]$exit
logout -[root root]#
Recovery. @@ -155,7 +165,8 @@ install material (OS CDs, OpenACS tarball and supporting software) and repeating the install guide. Recreate the service user ($OPENACS_SERVICE_NAME).
Restore the OpenACS files and database backup file.
[root root]# su - $OPENACS_SERVICE_NAME
+Restore the OpenACS files and database backup file.
+[root root]# su - $OPENACS_SERVICE_NAME
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ cd /var/lib/aolserver
[$OPENACS_SERVICE_NAME aolserver]$ tar xzf /var/tmp/$OPENACS_SERVICE_NAME-backup.tar.gz
@@ -175,8 +186,9 @@
-Postgres. If the -database user does not already exist, create it.
[root root]#su - postgres
+Postgres. If +the database user does not already exist, create it.+[root root]#su - postgres
[postgres ~]$createuser $OPENACS_SERVICE_NAME
Shall the new user be allowed to create databases? (y/n)y
@@ -189,7 +201,8 @@ create any out-of-order database objects. Next, restore the database from the dump file. The restoration will show some error messages at the beginning for objects that were precreated from the -OpenACS initialization script, which can be ignored.[root root]#+logout +su - $OPENACS_SERVICE_NAME +OpenACS initialization script, which can be ignored.
(many lines omitted) [$OPENACS_SERVICE_NAME ~]$+[root root]#su - $OPENACS_SERVICE_NAME
[$OPENACS_SERVICE_NAME ~]$createdb $OPENACS_SERVICE_NAME
@@ -200,11 +213,13 @@exit
[postgres ~]$exit
-logout
Activate the service
[root root]# ln -s /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/daemontools /service/$OPENACS_SERVICE_NAME
+Activate the service
+[root root]# ln -s /var/lib/aolserver/$OPENACS_SERVICE_NAME/etc/daemontools /service/$OPENACS_SERVICE_NAME
[root root]# sleep 10
[root root]# svgroup web /service/$OPENACS_SERVICE_NAME