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