Backing up db

Hey Guys,
I am preparing to do the RT move from one machine to another.
I’m getting mysql installed on the new machine and will next install
RT on the new machine (and apache).

I understand now, that the transactions directory holds the text of the
tickts. However, I still don’t understand what the ‘database’ consists of.

If I want to do a backup of the database (before the move), is that done
via mysql commands or is it done by taring a directory or something
similar?

Thanks for all the help!

Ashby Gochenour

Backing up the database is probably just a case of:

/path/to/mysql/bin/mysqldump rt | gzip > rt.sql.gz

(the gzip is not compulsory :wink:

then when you’ve reinstalled or moved or whatever, you can squirt this file into your new mysql install (I can’t remember how to do this but I know it’s not too tricky, look here http://www.mysql.com/doc/ for clues)

YMMV

Sam :wink:

According to Ashby Gochenour:

Hey Guys,
I am preparing to do the RT move from one machine to another.
I’m getting mysql installed on the new machine and will next install
RT on the new machine (and apache).

I understand now, that the transactions directory holds the text of the
tickts. However, I still don’t understand what the ‘database’ consists of.

If I want to do a backup of the database (before the move), is that done
via mysql commands or is it done by taring a directory or something
similar?

Thanks for all the help!

Ashby Gochenour


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Windows has detected that you have moved your mouse; you must restart
your computer for changes to take effect…

  •                                                                          *
    
  • This email and any files transmitted with it are confidential and intended *
  • solely for the use of the individual or entity to whom they are addressed. *
  • Copying this email or in any way disseminating its content to any other *
  • person is strictly prohibited. If you have received this email in error *
  • please notify postmaster@eigroup.com *
  •                                                                          *
    

fnord***********************************************************

FWIW, here’s a script that I wrote to have my RT server send me a mail with
the contents of the database + text files. Will probably need some hacking if
you want to use it on your system.

THIS_SCRIPT=$0
MAILADDR=“rt-backup@codeconsult.ch”
RTFILES=/var/rt
MYSQLDUMP=“mysqldump -uroot -pzesecret rt”
DATE=$(date +%Y%m%d-%H%M%S)

make sure tmp files are deleted on exit

cleanup()
{
rm $TMPSQL $TMPTAR $TMPTAR.gz 2>/dev/null
}

trap ‘cleanup’ 0 1 2 15

create a compressed tar file of the mysql data

TMPSQL=/tmp/rt-data-$DATE-.sql
$MYSQLDUMP > $TMPSQL

tar this together with RT transaction data

and compress the result

TMPTAR=/tmp/rt-backup-$DATE.tar
tar cf $TMPTAR $TMPSQL $RTFILES $THIS_SCRIPT
gzip $TMPTAR

uuencode the result

TMPUU=/tmp/rt-uuencode-$DATE.tar
uuencode $TMPTAR.gz <$TMPTAR.gz > $TMPUU

mail result to backup receiver

mail -s “rt-backup-$DATE” $MAILADDR < $TMPUU

– Bertrand Delacr�taz, www.codeconsult.ch
– web technologies consultant - OO, Java, XML, C++

This is always a good idea. Just for the heck of it, IMHO it is good practice to do:
mysqldump -u -p -A | gzip > database_backup.gz

I do this on a nightly basis just before my backups (to tape) go start up.

-Rich
Richard West mailto:rwest@wesmo.com
Wesmo Computer Services http://www.wesmo.com
Register Your Domain For Got TV?
As Little As $14.95/yr! Get your .TV!

This is always a good idea. Just for the heck of it, IMHO it is good
practice to do:
mysqldump -u -p -A | gzip > database_backup.gz

I see only one problem with this: Anyone who does a ps on your machine is
able to see your rootpassword :frowning:

Regards,
Adriaan Peeters

Rich and All,
Thank you for the advice.
I’m not experienced with mySQL: would the -u -p be for the root sql user
or for the actual root login on the machine? Also, does anyone know where
to find the sql u/p? I set up mysql with a debian package and picked the
passwords and I have no idea what I set them :frowning: (I’ve never connected to
the rt database)

Thanks again for all the help guys!

Ashby GochenourOn Thu, 5 Apr 2001, Rich West wrote:

This is always a good idea. Just for the heck of it, IMHO it is good practice to do:
mysqldump -u -p -A | gzip > database_backup.gz

I do this on a nightly basis just before my backups (to tape) go start up.

-Rich

Richard West mailto:rwest@wesmo.com
Wesmo Computer Services http://www.wesmo.com
Register Your Domain For Got TV?
As Little As $14.95/yr! Get your .TV!

Backing up the database is probably just a case of:

/path/to/mysql/bin/mysqldump rt | gzip > rt.sql.gz

(the gzip is not compulsory :wink:

then when you’ve reinstalled or moved or whatever, you can squirt this file into your new mysql install (I can’t remember how to do this but I know it’s not too tricky, look here http://www.mysql.com/doc/ for clues)

YMMV

Sam :wink:

According to Ashby Gochenour:

Hey Guys,
I am preparing to do the RT move from one machine to another.
I’m getting mysql installed on the new machine and will next install
RT on the new machine (and apache).

I understand now, that the transactions directory holds the text of the
tickts. However, I still don’t understand what the ‘database’ consists of.

If I want to do a backup of the database (before the move), is that done
via mysql commands or is it done by taring a directory or something
similar?

Thanks for all the help!