ArticleStorageSwitch.pl: not removing Attachments from DB?

Moderator: crythias

Locked
inet
Znuny newbie
Posts: 11
Joined: 20 Feb 2012, 10:32
Znuny Version: OTRS31
Real Name: INTERNET AG
Company: INTERNET AG

ArticleStorageSwitch.pl: not removing Attachments from DB?

Post by inet »

Hello,

after quite some hassle I just ran 'ArticleStorageSwitch.pl -s ArticleStorageDB -d ArticleStorageFS' successfully over our up-to-date OTRS 3.1.6 setup. It took quite some attempts to succeed. First some old articles had attachments without filename, and adding a filename in the database didn't help. Only way to solve it was to delete the ticket with GenericAgent. Then some attachments had issues with the filename encoding. Here it was sufficient to change the filename inside database. But finally ArticleStorageSwitch.pl ran over all 350.000 tickets and reported success: "NOTICE: done."

Now I checked size of the MySQL database and was quite supprised that it's still as large (12GB) as before the ArticleStorageSwitch script ran. I thought that the script would remove the attachments from database after copying them to the filesystem. /opt/otrs/var/article now has the same size (12GB).

Is there an option to remove the attachments from database after successfully moving them to filesystem? Or is it save to simply clear the database table article_attachments?

Regards,
jonas
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: ArticleStorageSwitch.pl: not removing Attachments from D

Post by jojo »

did you also run an optimize table in the database afterwards?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
inet
Znuny newbie
Posts: 11
Joined: 20 Feb 2012, 10:32
Znuny Version: OTRS31
Real Name: INTERNET AG
Company: INTERNET AG

Re: ArticleStorageSwitch.pl: not removing Attachments from D

Post by inet »

Yes, I first switched TicketStorageModule, then ran ArticleStorageSwitch.pl and finally ran 'optimize table' for MySQL tables ticket, ticket_history and articles.

From your question I deduce that the ArticleStorageSwitch usually deletes attachments from the database after they have been successfully copyed to the FS?

Is it possible to delete all copied data manually from the database? If yes, how?
bbbo
Znuny newbie
Posts: 4
Joined: 15 May 2012, 18:29
Znuny Version: 3.1.5

Re: ArticleStorageSwitch.pl: not removing Attachments from D

Post by bbbo »

optimize article_plain and article_attachment (and probably article_flag) too...
inet
Znuny newbie
Posts: 11
Joined: 20 Feb 2012, 10:32
Znuny Version: OTRS31
Real Name: INTERNET AG
Company: INTERNET AG

Re: ArticleStorageSwitch.pl: not removing Attachments from D

Post by inet »

Great, optimizing these tables finally reduced the MySQL database size from 12G to 2.9G. Thanks for the hint. Maybe this should be documented at http://doc.otrs.org/3.0/en/html/perform ... rs-storage though.
Locked