IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links
wiki:HeathersInstructionsToCopyGpc1ForTestingPurposes

Version 1 (modified by heather, 12 years ago) ( diff )

--

How to copy the gpc1 databases for code testing purposes

Once upon a time, the gpc1 database was small enough to take one of the backup dumps to ingest into a database (of a slightly different name, like haf_gpc1) which was extremely useful for testing purposes. One example is code changes to addstar which is hard to debug without testing it with a live database, but which also may end up creating a mess on the real database.

The new method is to rsync a copy of the mysql database (off of ippdb03), and configure one of the other machines to host it (brain transplant). The instructions have been split up by machines

ippdb03

The following steps are to be done on ippdb03, as root:

cd /var/lib/mysql du -h mkdir /data/(place with enough space).0/heather_gpc1_copy rsync -rvua /var/lib/mysql/ heather@(placewitheoughspace):/data/(place with enough space).0/heather_gpc1_copy/

wait for the copy to finish. Note that I didn't stop the gpc1 database - I assumed whatever it had is good enough for my purposes (hopefully it will be?)

(new machine)

I did this on stare01 because I know those machines - they are high memory, they have mysql that I use for the temp ipptopsps databases. This first attempt was a bit tricky because i had to shift the ipptopsps databases to stare01.1 (because of out of space problems). Note that this is a brain transplant -- the exisiting databases are shoved aside and are unusable, so check that A) there are no databases on that machine so you can do this, and B) if there are databases that no one is using them and it's ok to do that.

as root on new machine:

  • Stop mysql and make sure it's Dead
    • /etc/init.d/mysql stop
    • ps auxw | grep mysql
    • kill -9 (mysql id if still running)
    • (check that mysql is not running)
  • move the copy of gpc1 into place
    • /var/lib/mysql usually points to /data/stare01.1/mysql, for example. Move that mysql out of the way ---
    • cd /data/stare01.1
    • mv mysql mysql.save
  • start mysql with the usually variety of
    • /etc/init.d/mysql stop
    • /etc/init.d/mysql start
    • (maybe a zap as needed)
  • add accounts, you will need to do:
    • mysql -u root
    • CREATE USER 'ipptest'@'%' IDENTIFIED BY 'ipptest'
    • GRANT ALL on *.* to 'ipptest'@'%';
    • show grants;
  • should be able to mysql -h stare01 -u ipptest -pipptest gpc1

Note: See TracWiki for help on using the wiki.