Create a publisher and a subscriber
In this task you link your company file (the publisher) to another file on another server (the subscriber), so that transactions move between them on a schedule you set. You do three stages in order: the distributor once, then the publisher, then a subscriber for each file. All wizard fields and pages are in Replication wizards, and the roles are explained in Understanding replication.
Before you begin
- Open the publisher file and open the replication system. All its opening conditions apply.
- Prepare a sharing folder on the network whose path starts with
\\, and that the publisher's and the subscriber's accounts can read from and write to. - Prepare a Windows account that runs the replication jobs, in the form
Domain\Account. - The subscriber database must already exist on its server, with a version equal to or newer than the publisher's. The wizard does not create a new database.
- Register the subscriber's server with New Server (Add Database Server) before you create the subscriber.
- For the Branches and Types type, enable the branches system and define a branch card. Prepare a source code and a source name for each subscriber.
- The number of subscribers must not exceed what the licence allows.
Steps
Stage 1: Define the distributor (once)
-
In Replication System click Settings in the Settings group. The wizard opens. The button is disabled if the file already has a distributor.
-
Click Next on the welcome page.
-
In Folder Path type the sharing folder path, such as
\\SRV01\ReplData. -
Choose Replication Type: Branches and Types if your subscribers have branches, or Types if not. You cannot change it later without deleting the replication system.
-
In Account Name type the Windows account, such as
ALWAHA\replsvc, and its password in Password, then click Next. If the program does not accept the account, you stay on the page. -
On the last page check Server Name, Description, User Name and Password. The initial values come from the open file. You type the server name yourself (it has no list); the program records it for the distributor and checks the connection to it with the SQL credentials. The distributor itself is created on the server of the open file.
-
Click Start. The program waits until it creates the distributor, then "Successfully added" appears and the window closes.
Stage 2: Create the publisher
-
Click Create Publisher in the Create group. It works only after stage 1.
-
Click Next on the welcome page.
-
In Articles Name select the articles you want to synchronize. Main Article, Materials and Groups and Accounts are always selected. Selecting Bills selects Entries automatically.
-
Choose Sync Direction of Main Article. You set it once now, and it does not change while the article is published.
-
Select Clear syncing tables after and type the number of days if you want synchronization data cleared after a period; otherwise leave it.
-
Click Start. "Successfully added" appears and the window closes, and the Providers tree shows the Publisher node with the file's database and its articles under it.
Stage 3: Create a subscriber (for each file)
-
Click Create Subscriber. It works only when an article is published. Click Next.
-
Choose Server Name from the registered servers, then Select Database from the Alameen databases on that server.
-
Select Initialize Subscriber if this is the first time you set up replication for this database, so the program moves the initial data to it.
-
Choose Branch if the field shows, and type Source code and Source name (the program does not stop you leaving it empty), such as
02andJeddah Branch, then click Next. If the database already has a branch or a source, the program fills it in. -
In the grid, select the articles the subscriber receives. Expand an article to choose its types (such as bill types). Click Next.
-
On the Schedule Details page choose when synchronization runs, such as Daily, Repeat every
1day and One Time at23:00:00. The fields are explained in the shared schedule page. -
Click Start. "Successfully added" appears and the window closes, and the subscriber shows in the tree under every article you chose.
Result
- After stage 1: the distributor exists, the replication type and the main source are saved, and the Create Publisher and Delete Replication buttons are enabled.
- After stage 2: the file is a publisher, every article has a snapshot, and Create Subscriber is enabled.
- After stage 3: the subscriber has a subscription and a schedule for each article, run by the SQL Server Agent service. Synchronization runs at the times you set. You can run it at once with Sync Subscriber, and follow its result in Replication System.
- This task creates no entries and changes nothing in accounts or stock.
If something goes wrong
All the messages are in Replication wizards. The most common:
| Message | Why it appears | What to do |
|---|---|---|
| Incorrect windows username or password | The Windows account is wrong, or a step of creating the distributor failed. | Check the account, folder and server, then try again. |
| You should define a branch card to specify the replication type by branches and forms | You chose Branches and Types and no branches are defined. | Define a branch or choose Types. |
| Subscriber Database version is out of date, you should update to complete the process | The subscriber database is older than the publisher. | Update it, then try again. |
| The source code already exists | The source code belongs to another subscriber. | Type a different code. |
| The allowed subscribers count has been exceeded | You went over the number of subscribers allowed. | Delete a subscriber or ask for a wider licence. |
If Start in the publisher or subscriber wizard ends without a message and the wizard stays open, a step failed: check that SQL Server Agent is running and the server and Windows account data, then try again.
Related
This page applies to alameen ERP 10, version 10.1.79.764.