* Updated some of the documentation
[citadel.git] / citadel / docs / import-export.txt
1    
2  HOW TO USE THE IMPORTER/EXPORTER
3  --------------------------------
4  
5  Citadel/UX now contains an importer/exporter module, affectionaly known as the
6 "Art Vandelay" module (a not-so-obscure Seinfeld reference).  It allows you to
7 export the entire contents of your Citadel databases to a flat file, which may
8 then be imported on another system.  (This procedure is also known as "dump and
9 load" to some database gurus.)
10  
11  Why would you want to do this?  Here are some scenarios:
12
13 -> You are moving a Citadel installation to another computer, which uses a
14    different CPU.  Since Citadel stores data in an architecture-dependent
15    format, the data files wouldn't work on the new computer as-is.
16
17 -> Your computer crashed, lost power, etc. and you suspect that your
18    databases have become corrupted.
19  
20 -> You want to switch to a different back-end data store.  (For example, from
21    GDBM to Berkeley DB)
22  
23
24  
25  So ... how do we work this magic?  Follow these steps *exactly* as documented,
26 and you should be able to do it all with very little trouble.
27
28
29 1. This should be obvious, but it's still worth mentioning: MAKE SURE YOU
30 TAKE A BACKUP OF EVERYTHING BEFORE YOU START THIS!!  You're performing a
31 major operation here.  Don't risk it.
32
33
34 2. First, get all the users logged off from your system.  Disconnect it
35 from the network if possible.  You don't want anyone logging in while
36 you're doing this.
37
38
39 3. Log on as root, or some other user that has read/write access to all
40 relevant files.
41
42
43 4. Go to the directory that Citadel is installed in.  For example, issue a
44 command like "cd /usr/local/citadel"
45
46
47 5. Export the databases with the following command:
48
49    ./sendcommand "ARTV export" >exported.dat
50
51  This command may run for a while.  On a very large system it could take
52 an hour or more.  Please be patient!
53
54
55 6. When the export completes, check to make sure that
56 "exported.dat" exists and has some data in it.
57 (Type "ls -l exported.dat")
58
59
60 7. Shut down the Citadel server.  If you have a line in /etc/inittab that
61 reads like this:
62
63 c1:2345:respawn:/usr/local/citadel/citserver -h/usr/local/citadel
64
65  ...then you should change the "respawn" to "off" and then type
66 "/sbin/init q" to make the changes take effect.
67
68
69 8. Now it's time to delete your current binary databases.  Type:
70  
71   rm citadel.config citadel.control data/*.gdbm
72
73
74 9. If you're moving Citadel to another computer, you should move the
75 *entire* directory over at this time.  exported.dat only contains the
76 information that was in the binary databases.  Information which was
77 stored in portable formats doesn't need to be exported/imported, so you
78 must bring it all over in its current form.
79
80
81 10. Now get Citadel running on the new computer (or whatever).  Run setup
82 (documented in install.txt) and turn the service back on (from
83 /etc/inittab) but DO NOT log in.
84
85
86 11. As root, run the import command:
87
88   ./sendcommand "ARTV import" <exported.dat
89
90  This will import your databases.  Again, it may run for a long time.
91
92
93 12. Restart the Citadel server.  You can do this any way you like.  From
94 the command line, you can do it with a command like:
95  
96   ./sendcommand "DOWN"
97
98
99 13. Now you're finished.  Log in and test everything.  You may delete
100 exported.dat at this time, or you might want to save it somewhere as a
101 sort of pseudo-backup.
102