9 # If we're on an Easy Install system, use our own db_ tools.
11 if [ -x /usr/local/ctdlsupport/bin/db_dump ] ; then
12 export PATH=/usr/local/ctdlsupport/bin:$PATH
20 Citadel Database Cleanup
21 ---------------------------
23 This script exports, deletes, and re-imports your database. If you have
24 any data corruption issues, this program may be able to clean them up for you.
26 Please note that this program does a Berkeley DB dump/load, not a Citadel
27 export. The export files are not generated by the Citadel export module.
30 MAKE A BACKUP OF YOUR DATA BEFORE ATTEMPTING THIS. There is no guarantee
34 citserver must NOT be running while you do this.
37 Please try "db_recover -c" from the data/ directory first. Use this tool
38 only if that one fails to fix your problem.
42 echo -n "Do you want to continue? "
46 "y" | "Y" | "yes" | "YES" | "Yes" )
48 echo DO NOT INTERRUPT THIS PROCESS.
55 for x in 00 01 02 03 04 05 06 07 08 09
58 echo Dumping $filename
59 db_dump -h ./data $filename >/tmp/CitaDump.$x || die
60 rm -f ./data/$filename
63 echo Removing old databases
66 for x in 00 01 02 03 04 05 06 07 08 09
69 echo Loading $filename
70 db_load -h ./data $filename </tmp/CitaDump.$x && {
71 rm -f /tmp/CitaDump.$x
76 echo Dump/load operation complete. Start your Citadel server now.