How to set up a sync partner:
First note that a Sync partner may NOT use the Source server priority as a
proxy. it HAS to have a predefined priority in order to be set up. (I use
priority 75)
In order to set up a sync partner, you need to have the following in place:
1. A Source Server with Merge Replication set up successfully.
2. A Client Machine with a database matching the server's structure (MSF
restoration)
Setting up the server side of the Sync Partner:
1. On the Source Server, Register the Client pc as a SQL machine (Successful
connection irrelevant, we just want the name available)
2. Mark the Client as a publisher.
3. Right click on the existing Publication, Select Properties, go to the
Sync Partners tab and check the box allowing sync partners.
4. You should see the machine you just marked as a publisher. Check it
5. Apply changes.
(Now do the client side)
Setting up the client side of the Sync Partner
1. If the database is blank and you have an MSF file, restore it and remove
the subscriptions automatically added by it.
If the database is blank, set up a subscription and sync to get the
tables and data for the next step.)
2. Create a Publication and select the relevant tables to be included. (This
publication should be an exact copy of the one on the Source
Server --Remember, you're gonna get data from it, so your publication should
look exactly like it to prevent problems)
3. Now Go to the Sync Partners tab at the Client PC and mark the Source
server as a Sync partner as well. (See steps in Source Server Setup)
4. Sync with the central server. (This should be quite quick. Note that the
client now uploads data (no rows sent though) and runs through your article
list. This stores a record of this publication on the client.)
5. Create a Snapshot file on the client machine. This machine is now a Sync
Partner
6. Create a MSF file.
Setting up a Subscription to Sync to a Sync Partner (From no database)
1. Restore the MSF file created by the sync Partner (Not necessary if the
database has synced before or has the schema information)
2. Note that there is now a push subscription to the sync partner in the
database. (I think this is a bug as the push subscription doesn't work and
you can't create a pull subscription while it exists. You also can't remove
it using conventional means.) To remove the Push subscription, open the
sysmergesubscriptions table in your database, note that there is only one
record with a last_validated value. It probably also contains the name of
the sync partner. Remove this record. The push subscription will now be
gone.
3. Create a Pull subscription to the SOURCE SERVER as you would normally
5. open the properties of the new subscription, Go to the Synchronization
tab and select the Agent Properties button
- Go to the Steps tab and double click on the "Run Agent" line (in grid)
- In the command window, add "-SyncToAlternate" to the end of the
command (After Distributor [SERVERNAME] in my case)
-Apply changes and go back to the synchronization tab
6. Now go to the Snapshot file location tab and select "Get Snapshot from
the following folder"
- Enter the location on the local machine you want to store the
snapshots to use in. (I chose c:\CDs)
7. Copy the UNC folder from the Sync partner into the specified directory
(Resulting in a folder like c"\CDs\UNC\...)
8. The client is now prepped for an alternate sync partner.
Syncing to an alternate Sync Partner:
I have done this in 2 ways:
1. Using Windows Synchronize tool:(Start|Programs|Accessories|Synchronize
a. Select the subscription you just created and choose "Setup" (You
should be presented with login credentials)
b. Fill in the details of the sync partner instead of the details of the
Source Server in all the tabs. (In my case that meant replacing the
machinename of the Source Server with that of the Sync Partner)
c. Click Synchronise
d. Note that the responses should actually read that an alternate sync
has started. (I Ensure this happens by making sure the Source Server is not
visible from this location at all)
e. This sync usually updates at around 140/s, but it depends on the
machine. I have had as low as 32/s.
f. I usually sync a second time after completion just to ensure no
changes get sent again.
2. Using AciveX controls in Vb.NET:
a. Keep everything exactly the same as for normal sync. (Replace the
Distributor and Publisher details as above though -- we need to point to the
correct machine)
b. use the following additional parameters: oMerge.SyncToAlternate =
TRUE (Indicates that this is an alternate Sync location)
oMerge.AltSnapshotFolder = "C:\CDs" (Location of the snapshot file)
where oMerge is an object SQLMERGXLib.SQLMerge.
(If you need to know more about Syncing with VB, feel free to mail me.)
In theory, if you now sync with the Sync partner, it should once again
upload data and run through the article list, adding the record of the
subscription's updated to the Source Server.
If you now sync with the Source Server using the subscriber again, it should
not download all changes again. (I have had this work before, but it is
erattic. Once I figure out why I will post it here again. If anyone knows
why, please post it here as well.)
The above steps are what I've figured out thusfar. It may not be the best,
or even the correct way of using Sync Partners. In fact, If you know a
better way, or answers to the main post's question, please post it here.
Hope this helps
Regards
Paul Kleynhans
[quoted text, click to view] "Ray Ridley" <rridley@combix.com> wrote in message
news:170501c3e04c$598d3ab0$a101280a@phx.gbl...
> How did you set up the sync? I am having problems getting
> it to work.
> Is there a paper on it or where can I get the setup. I
> tried the help files. Thanks for any help.
> >-----Original Message-----
> >Hi
> >In order to avoid sending millions of records over a
> telephone line the
> >first time a subscriber synchronises, I've recently
> tried finding alternate
> >ways of synchronising. I came up with Synchronization
> Partners.
> >
> >If I understand the documentation correctly, a Sync
> partner is used as an
> >alternate sync site when there is a better connection
> available to a
> >subscriber. This means that if I can move a sync partner
> machine to the
> >location of a subscription, I can sync over the LAN
> instead of the telephone
> >line.
> >
> >I tested the sync over LAN and it works fine. Here is
> the problem though:
> >
> >For some reason, when I sync to the Sync partner, the
> subscription downloads
> >all required changes (In my case around 500 000). These
> change occur at
> >around 140/s (a lot better than the 3/s we get on a
> telephone line). When I
> >then sync to the central server, however, instead of
> downloading 0 changes,