Solved

How to create a empty replica?

Posted on 2001-08-28
11
2,429 Views
Last Modified: 2013-12-18
I'm trying to create an empty replica database.
After creating this empty replica database, I will use API to create a selective replication formula.
Then the replicator will do the rest, I hope.

What I want is this.
- I have a database with 1000 documents.
- I want to create a replica without documents, through lotus-script.
- Create the selective replication formula (API).
- Replicate (about 15 documents are replicated).

I tried the standard functions (like CreateReplica), but you cannot use "Replication Options".
Does anybody know how to create this empty replica?
0
Comment
Question by:CommView
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 4

Expert Comment

by:martijnmulder
ID: 6431123
what we have done is create an empty replica manually (just select an emtpy view or folder in the replication settings) and attach that empty replica to a document. using lotusscript you can then detach it.....

martijn
0
 
LVL 18

Expert Comment

by:marilyng
ID: 6433258
How empty do you want it to be?  Else delete stubs and design stubs will go with it and if the "empty" replica is held after the server purges it's delete and design stubs, those that sit on the empty will come back.

To avoid having the stubs replicate, we normally enable the "do not send deletions to other replicas", create a new replica, (restore the delete on the original), then in replication advanced settings change the "remove files older than --" to 0.

Compact the new replica should remove the design stubs.

Verify with Notes Peek.

(Note: if your server version is live, then I would recommend spawning a local replica and creating a clean replica from that one.

But this is probably not what you are looking for.. smile.
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6435262
How about first setting a replication formula that won't select any documents in the original database, create the replica and then changing the replication formula to whatever you want ?
Just thinking out loud, here ;-)
0
 

Author Comment

by:CommView
ID: 6435423
I will try to work out the idea of having an empty replica attached. Seems a good suggestion to me!

On another site I got a suggestion of using API to create an empty replica. This would do better and makes it easier for employees/customers to work with.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 6436652
Just a quick note, on the last project we had to create empty replicas for installation CD's, and we went through a long process trying to create these without having the design and delete stubs carry into the replica.  However, this was in Notes 4.6, so the API for R5 might have a few bells and whistle calls that can remove the stubs.. we were not successful using the API.  The delete and design stubs carry into the replica and are hidden files.

Reason we noticed this is because a user who had trained on an application, but didn't use it for six months, found she had new duties that required her to use it.  So, when she installed using the CD and then replicated, about 500 training document stubs and an assortment of design elements migrated up to the live application on the server.

If you're sure that your replica will be generated every 30 or 60 days, then you won't have a problem.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Accepted Solution

by:
asselin earned 200 total points
ID: 6437937
This seems to be what you are looking for. Note that this code was used with Notes 4.6.

DECLARATIONS:
=============

Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" _
( Byval hdb As Long ) As Integer
Declare Function W32_NSFDbCreateAndCopy Lib "nnotes.dll" Alias "NSFDbCreateAndCopy" _
(Byval srcDb As String, Byval dstDb As String, Byval NoteClass As Long, Byval limit As Long, Byval flags As Long, retHandle As Long) As Integer

Const NOTE_CLASS_DOCUMENT = 1                                                 '/* document note */
Const NOTE_CLASS_DATA = NOTE_CLASS_DOCUMENT                '/* old name for document note */
Const NOTE_CLASS_INFO  = 2                                                            '/* notefile info (help-about) note */
Const NOTE_CLASS_FORM  = 4                                                          '/* form note */
Const NOTE_CLASS_VIEW  = 8                                                           '/* view note */
Const NOTE_CLASS_ICON  = 16                                                          '/* icon note */
Const NOTE_CLASS_DESIGN = 32                                                       '/* design note collection */
Const NOTE_CLASS_ACL = 64                                                              '/* acl note */
Const NOTE_CLASS_HELP_INDEX = 128                                             '/* Notes product help index note */
Const NOTE_CLASS_HELP  = 256                                                         '/* designer's help note */
Const NOTE_CLASS_FILTER = 512                                                       '/* filter note */
Const NOTE_CLASS_FIELD = 1024                                                       '/* field note */
Const NOTE_CLASS_REPLFORMULA = 2048                                       '/* replication formula */
Const NOTE_CLASS_PRIVATE = 4096                                                  '/* Private design note, use $PrivateDesign view to locate/classify */
Const NOTE_CLASS_DEFAULT = 8192                                                 '/* MODIFIER - default version of each */
Const NOTE_CLASS_NOTIFYDELETION = NOTE_CLASS_DEFAULT '/* see SEARCH_NOTIFYDELETIONS */
Const NOTE_CLASS_ALL  = 32767                                                        '/* all note types */
Const NOTE_CLASS_ALLNONDATA = 32766                                       '/* all non-data notes */
Const NOTE_CLASS_NONE = 0000                                                       '/* no notes */
Const DBCOPY_REPLICA = 1
Const DBCOPY_SUBCLASS_TEMPLATE = 2
Const DBCOPY_DBINFO2 = 4
Const DBCOPY_SPECIAL_OBJECTS = 8
Const DBCOPY_NO_ACL = 16
Const DBCOPY_NO_FULLTEXT = 32
Const DBCOPY_ENCRYPT_SIMPLE = 64
Const DBCOPY_ENCRYPT_MEDIUM = 128
Const DBCOPY_ENCRYPT_STRONG = 256
Const DBCOPY_KEEP_NOTE_MODTIME = 512

HERE'S THE CODE:
================

     Dim dbHandle As Long
     Dim srcdb As String
     Dim dstdb As String
     Dim srcServer$, SrcFilePath$, destServer$, destFilePath$
     
     srcServer = "Source db server name"
     srcFilePath = "Source db path & name"
     dstServer = "Destination db server name"
     dstFilePath = "Destination db path & name"
     
     If srcServer = "" Then
          srcdb = srcFilePath
     Else
          srcdb = srcServer & "!!" & srcFilePath
     End If
     
     If dstServer = "" Then
          dstdb = dstFilePath
     Else
          dstdb = dstServer & "!!" & dstFilePath
     End If
     
     rc =  W32_NSFDbCreateAndCopy( srcdb, dstdb, NOTE_CLASS_ALLNONDATA, 0, DBCOPY_REPLICA, dbHandle )
     
     If rc = 0 Then
          Print "Replica created with success [" dstDb & "] [" & Cstr(rc) & "]"
     Else
          Print "Error. Replica not created [" & dstDb & "] [" & Cstr(rc) & "]"
     End If
     
     If dbHandle <> 0 Then rc = W32_NSFDbClose( dbHandle )

Hope this helps!
0
 

Author Comment

by:CommView
ID: 6450589
It's clear to me who earns this points!!
- martijnmulder your answer was very creative, but I guess you will use the code from asselin next time.
- marilyng, thanks for your suggestions and remarks!
- jerrith, don't stop thinking out loud... you never know!

asselin, your code seems the work fine.
Thanks again!

0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6450614
Well, I've learned something from this question too, so thinking out loud helped :-)
0
 
LVL 18

Expert Comment

by:marilyng
ID: 6451225
You're welcome..
Marilyng
0
 
LVL 4

Expert Comment

by:martijnmulder
ID: 6456723
CommView
i was just wondering if you could post the code you will use to create the selective replication formula ? We are doing  something similar and having some problems with it....
0
 
LVL 3

Expert Comment

by:Kraeven
ID: 24294529
I've tried this code, but I keep on getting :

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Method : Int32 W32_NSFDbCreateAndCopy(System.String ByRef, System.String ByRef, Int64, Int64, Int64, Int64)


VB.NET 2008
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now