Thread: Re: [CSCMail-Users] MySQL
Brought to you by:
countzer0
From: Olli <obi...@gm...> - 2000-08-16 08:28:49
|
Daniel, I did the same and also like the speed :-) I got my adressbook from CSV with the migration-script dbswitch.pl from the <cscmail-dir>/migration-scripts directory. How ever I had to change the line $conn=&open_db_conn; to something like $conn=DBI->connect("DBI:mysql:database=databasename;host=localhost", "dbuser", "dbpassword",{'RaiseError' => 1}); Also I commented out the following line: # &create_database; After creating a database and putting the proper permissions to it (I used xmysqladmin), this script would then setup all the neccessary tables, e.g. messages, adressbook, accounts ... At least, I was successful. Hope that helps Oliver On 15 Aug 2000 21:37:54 CEST, Dr. Shreger said: > I recently changed to MySQL and I love the speed improvement. > But now I have a little question: is there a possibility to import my > old > (CSV) Adressbook? > I'm using CSCMail 1.6.1 > > Daniel > > _______________________________________________ > | Be sure to read the CSCMail FAQ: > | http://www.cscmail.net/cscmail.faq > | > | CSCMail Home Page: > | http://www.cscmail.net > | > | To unsubscribe or change your preferences: > | http://lists.sourceforge.net/mailman/listinfo/cscmail-users > > -- Dulce et decorum est pro patria mori Olli B. Fon: 030-47475624 Mail: obi...@gm... -- |
From: Daniel S. <np...@gm...> - 2000-08-16 20:47:54
|
I think this is what I searched for, thanks. The command filled my addresses-table with 50 empty entries instead of 50 addresses and it produced the following output on the console. npfdd.addresses: Records: 50 Deleted: 0 Skipped: 0 Warnings: 200 I finally figured out that the command should have been mysqlimport -l -p --fields-terminated-by=, databasename addresses Daniel PS: How do I export from mysql? (for a backup for example) On Tue, 15 Aug 2000 22:22:39 -0400 (EDT), Mark Neill MIDTIER wrote: > OK, I found the info I needed without the book.... > > Move the addressbook to a file named "addresses", and in that > directory, > run the following command (I think, I haven't tried it...) > > mysqlimport -L -p=password --fields-enclosed-by=, databasename > addresses > > Where password is (of course) your password > > Where databasename is your username on your system, > assuming you set up the CSCMail/MySQL interface by the books > > > Hope this is right.... > > --Mark > > > Mark Neill > Enterprise Backup & > UNIX Administrator > CSX Technology > Mar...@cs... > > On 15 Aug 2000, Dr. Shreger wrote: > > > I recently changed to MySQL and I love the speed improvement. > > But now I have a little question: is there a possibility to import > my old > > (CSV) Adressbook? > > I'm using CSCMail 1.6.1 > > > > Daniel |
From: <Mar...@cs...> - 2000-08-16 20:54:20
|
On 16 Aug 2000 17:40:15 CEST, Daniel Schregenberger said: > mysqlimport -l -p --fields-terminated-by=, databasename addresses Oops...oh well, pretty good for book knowledge :) > PS: How do I export from mysql? (for a backup for example) mysqldump Try "mysqldump --help" for options.... |
From: Daniel S. <np...@gm...> - 2000-08-16 21:23:06
|
On 16 Aug 2000 16:53:46 EDT, Mar...@cs... wrote: > On 16 Aug 2000 17:40:15 CEST, Daniel Schregenberger said: > > mysqlimport -l -p --fields-terminated-by=, databasename addresses > > Oops...oh well, pretty good for book knowledge :) > > > PS: How do I export from mysql? (for a backup for example) > > mysqldump Try "mysqldump --help" for options.... Thanks. Daniel |
From: Steven K. <st...@vo...> - 2000-08-16 13:23:45
|
On 16 Aug 2000 09:31:34 CEST, Olli said: > Daniel, > I did the same and also like the speed :-) > I got my adressbook from CSV with the migration-script dbswitch.pl > from > the <cscmail-dir>/migration-scripts directory. How ever I had to > change > the line > > $conn=&open_db_conn; > > to something like > > $conn=DBI->connect("DBI:mysql:database=databasename;host=localhost", > "dbuser", "dbpassword",{'RaiseError' => 1}); > > Also I commented out the following line: > > # &create_database; If run properly (from the cscmail directory, as specified in the docs) no modifications at all are needed to this script, it will create the new database for you and everything. Run it like this: (assuming you un-tarred CSCMail into /usr/src/cscmail ) [/usr/src/cscmail] ./migration-scripts/dbswitch.pl CSV mysql Notice that we are NOT in /usr/src/cscmail/migration-scripts running ./dbswitch.pl we are in the CSCMail directory, running ./migration-scripts/dbswitch.pl this is important, since dbswitch.pl uses csclib.pl... You have to run dbswitch.pl from a directory that contains csclib.pl You do NOT need to manually make your empty database if you do this. dbswitch.pl will make it for you. This will copy all tables... Filters, Messages, Addresses, Accounts, etc from the old database to the new one. If you have already manually done some parts of this migration, I do not recommend running dbswitch, because it assumes that there is no new database yet. I strongly suspect it will FAIL if you run it against an already setup database (which is what Daniel has.) Therefore, I recommend that Daniel use the mysqlimport method that Mark proposed to the list. dbswitch is designed to be run before you change .cscmailrc to point to the new db. So, full instructions for switching from CSV to another db are as follows: Download and install SQL db of choice (Postgres, MySQL, etc) use DB's administration utility to make an empty DB with the same name as your username. (in postgres its: createuser <username> and possibly (depending on the version) createdb <username> Consult mysql doc's or CSCMail INSTALL doc's for other db's) The following steps install the Perl DBD for your Database: perl -MCPAN -e shell install DBD::Pg (or DBD::mysql etc) quit Now we run dbswitch: cd /location/of/cscmail ./migration-scripts/dbswitch CSV Pg (or CSV mysql, etc) NOTE: DBD's are CaSe SeNsItIvE CSV must be all caps, mysql is all lowercase, and Postgres is "Pg". Now we edit ~/.cscmailrc changing the line DatabaseDriver: CSV to DatabaseDriver: Pg or mysql or whatever... remember case sensitivity. If your using MySQL and you need to put in DatabaseUser: and DatabasePassword: do so at this time. (They should be there, but empty) Now you are finally ready to run CSCMail. It should pop-up just like it did before, only faster. Everything should be fine, all data should be there. Once you have confirmed this, you can safely delete the ~/.cscmail/messages ~/.cscmail/folders ~/.cscmail/filters ... files (Anything that when you cat it looks like a Comma Seperated Value file...) DON'T delete any directories. -CZ -- ---------------------------------------------------------------------- Steve Kordik st...@vo... System Administrator Tel 212.332.5045 VOILA - France Telecom North America Fax 212.332.2362 1270 Avenue of the Americas New York, NY 10020 USA ---------------------------------------------------------------------- Customized Search Engines for your web site at: http://voilasearch.com ---------------------------------------------------------------------- |