This page has not been reviewed by our documentation team (more info).

How to turn a replication slave into a replication master

  • on the current master, ensure nothing is writing to the database any more

  • on the current master, do a full-dump export

  • suck up all the updates to the slave (i.e. run LoadReplicationChanges)

  • copy the non-replicated files to the slave

  • import the private files

    • I think this is best done by hand, as MBImport.pl does stuff with replication_control we may not like

    • The current moderator table will really be moderator_sanitised, so we need to replace that with the real moderator data.

    • A slave DB should have no foreign keys, so just blat the existing moderator table and re-import from the non-sanitised file

    • private tables:

          album_amazon_asin
          automod_election_vote
          moderator
          moderator_preference
          moderator_subscribe_artist
      
    • non-replicated tables:

      automod_election
      automod_election_vote
      moderation_open
      moderation_note_open
      moderation_closed
      moderation_note_closed
      moderator
      moderator_preference
      moderator_subscribe_artist
      vote_closed
      vote_open
      
    • Therefore, proceed as follows:

      • drop all indexes on the tables we're about to load

      • empty the moderator table

      • load all the non-replicated tables (including the "private" copy of moderator)

      • recreate the indexes we dropped

  • run CreateFKConstraints.sql

  • run CreateTriggers.sql

  • create the recordchange procedure

  • run CreateReplicationTriggers.sql

  • Change REPLICATION_TYPE

Est time for zim to stimpy:

25 mins to dump, 25 mins to copy, 5 mins to prep for import, ??? to import, ??? to create indexes, ??? to add FKs, 10 mins to create triggers, procedures, triggers and change control data. Total: 65 mins + import/index/FK time. Maybe approx 2 hrs in total.


CategoryHowTo CategoryReplication

 
Creative Commons EFF GPL LGPL This material is Open Knowledge Valid XHTML 1.1 Valid CSS 2.0
Original Design|vacubomb.com Contact details Server version: RELEASE-20071014