Tony Upson's picture

I know the built-in TLK A3 tool is recommended for backing up databases; but is there anything wrong with using the 'Webadmin' database backup option; as we want to avoid having to utilize pricing plan requirements?

If it is safe to use, after downloading the backup file locally and wanting to migrate it to a newly built virtual appliance, how do you restore the database into OTRS?

Forum: 
Tags: 
Jeremy Davis's picture

And if you just want a local backup then you can use it to do a data dump then manually deal with that data...

As for using the Webmin tool; TBH I have no idea. I have never used it. Assuming that it just does a dump of the database I assume that it would work. I suggest that if that's the way you want to go then test it out...

Doing manual dumps is all good for initial testing (and learning and even manual migration once in a while). However once in production IMO the cost of TKLBAM is easily offset by the fact that you don't need to think about offsite data backup except for a quick test every so often to confirm it's working as it should.

Tony Upson's picture

Its nice to hear (1) server is free; but what scares me is uploading database content of our Ticketing System that may have security passwords; sensitive data and/or other information that we do not want to be uploaded to the web. Yes, this may be nifty - but we are a Federal entity and that poses risks; be it its free and being transferred to a non-Federal online repository.

Is there any local utilities that work well? We basically export the configurations of OTRS through its in-application option; so realistically we just need a backup of the OTRS database as well. Not sure what else all is required for a successful backup/restore of OTRS, but I am interested in recommendations.

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

FWIW TKLBAM traffic is via an encrypted connection and you can set a password and escrow key so the data itself is encrypted and password protected. However I understand that that too is probably still irrelevant for you! :)

Like I hinted, you can still use TKLBAM locally (although you will still need a free Hub account to download the latest server profile). tklbam-backup accepts a "--dump=DIR: Dump a raw backup extract to path". E.g to backup to a directory named /backup:

rm -rf /backup # removes existing dir if it exists
mkdir /backup # remakes the dir
tklbam-backup --dump=/backup
You can then do as you please with the resulting files. To restore (assuming that you have put the files back in /backup):
tklbam-restore /backup
FWIW TKLBAM can be configured to backup to many different storage options (using the '--address=' switch) if you desire. See here. Note that some of these will require dependencies installed prior to them working.

Otherwise if you keep in mind that under the hood TurnKey v14.0 is Debian Jessie then anything that will work on it will work on these appliances. It will require some playing but some thing as simple as doing a mysql DB dump and a backup of the conf file(s) may be enough?

Update: Actually I just did a quick google and it seems that I was on the right track (see herethis quite old post that mentions doing a DB dump and restore). Although OTRS also appears to have a built in backup utility I haven't tested it but you can find info here. Obviously it won't be the same path but I imagine that they should be there somewhere.

Tony Upson's picture

Yes, these online instructions are a bit more tricky to try to mimic as the example paths are very off/different than how the ISO/Appliance has rendered out the installation of OTRS. Frankly, there is no /scripts/ path at al with the OTRS directory - thus the restore.pl is no where to be found.

The paths even mentioned in the OTRS documentation about backup/restore doesn't even appear to be accurate.

ref: http://otrs.github.io/doc/manual/admin/3.3/en/html/backup-and-restore.html

Seems like I am stumped at the moment with a finite solutionl; other than TKLBAM. Even though its free and encrypted, my Agency is not forking over a CC to add to the account; simply because Fed' Gov't procurements don't operate like that.

I am stuck :\

 

 

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

I could be wrong but I was under the impression that you could set the Hub up now for a free account without requiring a credit card. Even if you did you could probably just use one of those disposable pre-paid visa cards!?

Anyway you don't seem keen to pursue the TKLBAM path (which is fine BTW - I just thought that would by far be the easiest option).

I have decided to put aside what I was up to and have a bit more of a look into the issues that you have raised for the OTRS appliance. I'll see if I can find those scripts...

BTW I have just fixed my post above that had a link to a manual DB dump and restore. I would set up a second OTRS appliance in a VM to test this manual backup/restore (i.e. test migrating the DB between them). Once you have confirmed a way to do it; then you can make it into a simple script and set it up as a cron job.

Even though it must be a bit of a pain for you ATM this level of testing/usage/feedback is invaluable for us! If only you had been about and testing it before it was released! :)

Tony Upson's picture

Yes, you are required to plug in a Credit Card even for the FREE option. I went on and used my personal card snice it said it wasn't going to charge me at all; but it charged me $1 I assume as a verification requirement), at any rate, if there are more hidden fees in the future, i can cancel at any time.

I successfully backed it up to A3 within minutes (considering it is an empty DBA atm); but I would also like to back it up locally, as you indicated i can do both, so I am going to have a look at that now.

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

You will need to pay for the S3 storage space but it's pretty cheap. But if you want to delete the data files you can delete backups from within the Hub.

You may have needed to give Amazon your credit card perhaps? To pay for your S3 storage usage?

Jeremy Davis's picture

The scripts can be found here:
/usr/share/otrs/scripts
I haven't tested but would assume they would run like this:
/usr/share/otrs/scripts/backup.pl
Tony Upson's picture

i did the tklbam-backup -dump=/localdirectory and it backed it up just fine. When I nav to WebAdmni -> File Manager, I can see the otrs backup within the directory i created.

Question: how do i download this off the appliance to my local Windows system and/or a Network share?

(Thanks a bunch for helping out with tihs!)

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

To preserve all the file permissions you'll need to create an archive first.
cd /root
tar -zcf backup.tar.gz /backup

Then decide on how you will connect. There are a few options in the docs. I often use Filezilla but if you automate all this then something like winscp may be better?

Also before you restore your backup you'll need to unarchive it. Warning, this will delete your backup dir if it exists already.

rm -rf /backup
tar -xf backup.tar.gz -C /
Tony Upson's picture

Great, I'll try those commands, what port do you connect via FileZilla to get to the files? I have an FTP product installed (CoreFTP).

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

Default SFTP port is 22. In FIlezilla you can set the protocol (sftp) or the port (22) and it will work. I imagine it should work with CoreFTP too (assuming it supports SFTP - note FTPS is different!)
Tony Upson's picture

CoreFTP just didnt work well; once I downloaded WinSCP, I got into it successfully. Cheers!

- Tony

Network Engineer

Federal Gov't

Tony Upson's picture

ok, am I missing something?

i tried your archiving command, and the following occurs:

when I originally ran tklbam-backup -dump=/localdirectory it created several folders within that directory I am assuming that are required for a successful restore. however when i run your command in either that path and a newly created /backup at the root (just by your example), nothing occurs other than the "Removing leading..." message.

what am I missing? 

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

You need to make sure that you are pointing it to the directory that you sent your tklbam backup to. E.g.
cd /root
tklbam-backup --dump=/backup
tar -zcf backup.tar.gz /backup

If you have a look in /root there should be a file called "backup.tar.gz" and that is your backup...

Tony Upson's picture

ok, I found it, it is storing in the /<root>/root folder, according to WinSCP - not the actual <root> it shows. thanks again.

- Tony

Network Engineer

Federal Gov't

Tony Upson's picture

Sorry, can you hold my hand on the backup process here? I attempted to restore my backup.tar.gz file, but your commands I suppose will only work if the correct locations are probably inserted.

Overview:

(Common OTRS Directory Locations that I found)
/var/lib/otrs/
/usr/share/otrs/
/etc/otrs/
/run/otrs/

1. I created a backups folder within /var/

2. I ran the following commands

rm -rf /backup # removes existing dir if it exists
mkdir /var/backups/otrs # makes new dir

3. I then ran your commands:

cd /root
tklbam-backup --dump=/var/backups/otrs
tar -zcf backup01.tar.gz /var/backups/otrs

4. It created the necessary folders/files within /var/backups/otrs accordingly

5. It added the .tar.gz file to /root/root/ respectively

6. Restoration:

This is where I got confused, how do I restore these files now? You said to run:

rm -rf /var/backups/otrs
tar -xf backup.tar.gz -C /

I see the first line removes the directory specified... But where does this [ 'tar -xf backup.tar.gz -C / ] restore to? Does -C / know to restore to /var/backups/otrs?

7. Once it is restored, I suppose I just run tklbam-restore /var/backups/otrs/ and it puts things back in the proper locations?

Please confirm.

 

 

- Tony

Network Engineer

Federal Gov't

Tony Upson's picture

.

- Tony

Network Engineer

Federal Gov't

Jeremy Davis's picture

I think that it should still work; although because you have moved the directory maybe not? TBH I regularly google it (and then do some quick tests to confirm) as I rarely recall the exact format.

There is tons of info regarding common Linux commands online.

Steven Youngblood's picture

I am currently running turnkey-otrs-13.0-wheezy-amd64 and have just downloaded and installed turnkey-otrs-14.1-jessie-amd64 on to a VMWare server. In order for me to backup the old server and restore the database and all user info to the new server, will I need to create or open a TKLBAM account and get an API-KEY?

Thanks

 

Jeremy Davis's picture

So probably a lot of your info is in that post...

However, regarding TKLBAM, the easiest way is if use the Hub. That will allow your backups to automatically be stored in your AWS account's private S3 storage. You can then keep track of your backup from within the Hub.

It is possible to use TKLBAM without the Hub, but it is more involved and you need to keep track of your own backups.

Also I mentioned it on your thread, but please make sure you read the doc page on migrating to v14.x with TKLBAM. Even though it's the easiest way to go, when migrating data between versions it's still quite involved.

Steven Youngblood's picture

I have set up a hub account on Amazon and backed up my old system. I then tried to restore this backup to my new system, and I receive error which I am unable to post here due to it being blocked as spam.

Is there a complete document that describes how to do this? I have found examples of various ways to do this, but none have worked.

======================================================================

Old system = turnkey-otrs-13.0-wheezy-amd64

New system = turnkey-otrs-14.1-jessie-amd64

Jeremy Davis's picture

I replied to this in your thread.

Add new comment