Moving a replicated database

  • I have to move a replicated database to a new partition on the server. Is there anything I should watch out for? Is it as simple as detach/attach for the publication and subscriber DB's? Does the replication have to be set up again after the move?

     

    thanks

    TH

    Tim

  • You won't be able to dettach/attach in the publisher, but you should be able at the subscriber.

    you could try altering the database to create new files in the partition and empty the old ones, but I have never try it. Replication won't let you do any ALTER DATABASE on the published db.

    one solution (but very painfull), to drop the subscribers, then the publication, and then change the published property of the db, to be able to attach/dettach. Then set up all the replication environment again.

     

  • 1.perform a full backup of published db

    2. stop SQL Agent on  publisher

    2. perform a restore using 'with move' option :

    RESTORE DATABASE PublishedDB

       FROM DISK = 'drive:\PublishedDB.bak'

       WITH MOVE 'PublishedDB' TO 'drive:\newpath\PublishedDB.mdf',

       MOVE 'PublishedDB_log' TO 'drive:\newpath\PublishedDB.ldf'

    I have performed this on transactional replication environment

    HTH

    francoc

  • when you setup replication it has tenticales all over the place.

    Recomendation:

    1)stop all replication , give time for things to settle down.

    2)script out replication.

    3)remove replication from publisher.

    4)complete backup of the database (makes the database smaller)

    5)restore to new location.

    6)enable replication on the new database.

    7)run the replication scripts to re-create replication.

    8)create and apply the snapshots.

    9)re-create your replication agents.

    I know that this process is time consuming now, but it's better to spend the time now then to try and debug later.

    good luck..


    Don't count what you do, do what counts.

    SQL Draggon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply