SetupTasks » History » Version 10

« Previous - Version 10/36 (diff) - Next » - Current version
Chris Cannam, 2010-12-07 09:19 PM


Setup on new server tasks

  1. Install Apache, Postgres, Varnish, etc
  2. Install Ruby EE and Phusion Passenger
  3. Install (via gem) rake, rails version 2.3.5, pg, rmagick, ruby-openid
  4. Clone current soundsoftware code
  5. Set up postgresql user and initialise database
  6. Redmine initialisation
  7. Redmine permissions and ownership
  8. Basic Apache config for site on :81
  9. Varnish config for :80->:81
  10. PHP5 via fcgi
  11. Basic Drupal install
  12. Initial database load
  13. Pull across initial hg repos
  14. Configure SSL server
  15. Set up hgwebdir, reposman-soundsoftware, soundsoftware Apache auth (depend on SSL, db, web service key in db etc)
  16. Pull across remaining bits of redmine server that are not in hg (fonts, files, etc)
  17. Pull across Drupal theme etc
  18. Ensure machine can be routed to!
  19. Set up test instances

in the future: put old host in admin mode, re-point dns, final hg / database / redmine files update

MySQL to Postgres migration notes

Just to make things more fun, we're migrating the existing databases from MySQL to pgsql.

For Redmine, we don't attempt to dump and reload the schema -- more sensible to use Redmine to set up the schema (in case it has any database-specific set up) and then massage the data as we load it. We just dump and reload the row data. That way we only have to fix problems once.

mysql2pgsql does a reasonable job of converting the data, as far as it goes. Some problems remain:

$ grep ERROR log/dbload.log |sort|uniq
ERROR:  column "admin" is of type boolean but expression is of type integer
ERROR:  column "assignable" is of type boolean but expression is of type integer
ERROR:  column "hide_mail" is of type boolean but expression is of type integer
ERROR:  column "is_closed" is of type boolean but expression is of type integer
ERROR:  column "is_default" is of type boolean but expression is of type integer
ERROR:  column "is_in_chlog" is of type boolean but expression is of type integer
ERROR:  column "is_public" is of type boolean but expression is of type integer
ERROR:  column "mail_notification" is of type boolean but expression is of type integer
ERROR:  column "onthefly_register" is of type boolean but expression is of type integer
ERROR:  column "protected" is of type boolean but expression is of type integer
ERROR:  duplicate key value violates unique constraint "unique_schema_migrations" 
ERROR:  INSERT has more expressions than target columns
ERROR:  invalid input syntax for type bytea
$

The boolean ones are understandable -- mysqldump writes them out as ones and zeros and you can't tell they were intended to be boolean without the schema.

The duplicate key values we don't care about, in fact we're glad they're rejected, because they come from the Redmine db:migrate which we've already run anyway.

"INSERT has more expressions"... that's a strange one. Is our schema out of date?