¿Truncate and backup Database?

Moderator: crythias

Locked
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

¿Truncate and backup Database?

Post by AVillar »

Hello Everybody!

I want to divide my OTRS database by different years. One DB for 2008, another for 2009, another for 2010 and another for 2011 and 2102.
I want to use the 2008, 2009 and 2010 databases only for read. This database will go to a new server each. The another database will be the production DB.

How can I do that?

Thanks in advance!
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: ¿Truncate and backup Database?

Post by jojo »

not possible in OTRS
"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
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ¿Truncate and backup Database?

Post by crythias »

There is a possibility to delete tickets given a range via Generic Agent, though.
You should definitely positively be sure you have a good, tested, restorable backup, but you could do this:
Load the backup file in another database.
Delete from this database tickets in the range you do not want via Generic Agent
Export the resultant database as yearx.

Lather, rinse, repeat.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

crythias wrote:There is a possibility to delete tickets given a range via Generic Agent, though.
You should definitely positively be sure you have a good, tested, restorable backup, but you could do this:
Load the backup file in another database.
Delete from this database tickets in the range you do not want via Generic Agent
Export the resultant database as yearx.

Lather, rinse, repeat.
Great idea, I will be testing that.

Thank you!
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

Hello everybody.

I'm having problems restoring the backups. I can't find the exact procedure to restore the backup and not get any good result. This is not good for us. I tried this without success:

Try 1:
. Installed OTRS on a new Server (same OS than the original and same OTRS version).
. Copy OTRS backup files in folders: Apache, CronW, OTRS, OTRS4Win and StrawberryPerl.
. Restored MySQL Database from a big .SQL file using SQLYog.

Try 2:
. Installed OTRS on a new Server (same OS than the original and same OTRS version).
. Copy OTRS Backup files in folders: Apache, CronW, OTRS, OTRS4Win and StrawberryPerl.
. Installed opm packages in the new server. The packages were downloaded from the package manager of the original server.
. Restored MySQL Database from a big .SQL file using SQLYog.

Anybody have any kind of help?

Thanks in advance.-
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ¿Truncate and backup Database?

Post by crythias »

AVillar wrote:not get any good result
How do you expect to receive assistance if we don't know how to translate "not get any good result"?

What level of "It doesn't work" do you need assistance?
does sqlyog indicate that the import worked?
Is there data in the article and ticket tables?
Does the website show up?
Are there errors in logs?
Are you missing permissions?

We can't help you with generic "it doesn't work right" problems. Our crystal 8-ball says, "It should work. Try something else."
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

crythias wrote:
AVillar wrote:not get any good result
How do you expect to receive assistance if we don't know how to translate "not get any good result"?

What level of "It doesn't work" do you need assistance?
does sqlyog indicate that the import worked?
Is there data in the article and ticket tables?
Does the website show up?
Are there errors in logs?
Are you missing permissions?

We can't help you with generic "it doesn't work right" problems. Our crystal 8-ball says, "It should work. Try something else."
Hello Crythias. How are you? I hope you are all right.

When I say 'not get any good result' I'm telling that after restoring backup 'nothing was restored from backup'. There is no tickets, no agents, no customers, nothing. I check the database tables and everything looks ok, every table have their respective data just like the production server.

The website runs ok. If not, I can't install the OPM packages (I'm sorry, but I think this was obvious).

I guess I'm forgotten something really stupid and simple, It's very strange for me.

I have some errors in the log, But were solved after reinstalling the packages. There are another errors like 'Can't get file from' because the new server don't have internet connection. If I upload the log file can help you?

Thanks in advance, again.-
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ¿Truncate and backup Database?

Post by crythias »

AVillar wrote:There is no tickets, no agents, no customers, nothing. I check the database tables and everything looks ok, every table have their respective data just like the production server.
This sounds like Config.pm isn't pointing to the same database to which you restored. There might be other issues, but if the tables look okay, then this seems to be you're not looking at the same database.

"But I am"

Then I don't know what to say. If you're using sqlyog or MySQL Workbench or phpMyAdmin and you see articles and tickets then they should show up in OTRS. The possibility exists that for some reason you're an agent that has no access to the groups/queues to which the tickets are assigned.

"But I am"
Then the logs would tell you that it can't find ... something.

"But there are no logs"
Then you're connecting to the wrong database.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: ¿Truncate and backup Database?

Post by jojo »

did you delete also all caches?
"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
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

A little update:

After restored the backup (with Apache and CronW services stopped), the ticket table is full. After start both services, the table ticket left empty. And get this error on the log file:
[Wed Jan 16 16:20:01 2013][Error][Kernel::System::DB::new][181] Host 'servername' is not allowed to connect to this MySQL server

But the otrs.checkdb.pl says 'it looks Ok!'.

What is going on?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: ¿Truncate and backup Database?

Post by jojo »

is the database on the same host or on a different one?

If on the same host: check Config.pm as it miht point to the wrong one
If on other host: change user permissions for this database user, so you can connect
"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
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

I can connect to to the DB with sqlYog using the config.pm credentials. Also, I tested the connection with OTRS\OTRS\bin\otrs.checkdb.pl and everything looks OK. Is otrs.checkdb.pl using the same credentials that in config.pm?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ¿Truncate and backup Database?

Post by crythias »

AVillar wrote:Is otrs.checkdb.pl using the same credentials that in config.pm?
It should.
AVillar wrote:the table ticket left empty
Are you trying to run installer or just log in? It won't delete the tables just to start services.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

crythias wrote: Are you trying to run installer or just log in? It won't delete the tables just to start services.
After start both services, the table ticket left empty. The last procedure (explained) was:
. Installed OTRS on a new Server (same OS than the original and same OTRS version).
. Stop Apache and CronW Services.
. Copy OTRS Backup files in folders: Apache, CronW, OTRS, OTRS4Win and StrawberryPerl.
. Start Apache and CronW Services.
. Installed opm packages in the new server. The packages were downloaded from the package manager of the original server.
. Stop Apache and CronW Services.
. Restored MySQL Database from a big .SQL file using SQLYog.
. Ticket, users and article table looks intact.
. Start Apache and CronW Services.
. Ticket table is empty, users table only have root@localhost user, article table looks intact.

What is going on?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ¿Truncate and backup Database?

Post by crythias »

do not know. disable config.pm's database password and see if it happens again.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
AVillar
Znuny newbie
Posts: 37
Joined: 10 Apr 2012, 15:47
Znuny Version: 3.0.6

Re: ¿Truncate and backup Database?

Post by AVillar »

Problem solved. It was between SQLyog and MySQL.

Testing Generic Agent options Now.

Thanks a lot!
Locked