Jump to content

Different Database Version for one Main and more Sub Files


Recommended Posts

  • Newbies
Posted

Dear all, 

i have a problem with the Database Version from Mirror Sync. 

At first to explain. We have a Big Main file, where all Data come together. Connected to this Main file, we have several SubFiles. (currently around 4 but there will be more in the future) 

One of the SubFiles is an offline Version, which we use Mirror Sync to Synchronice a few Tables. The User press a Button in the Sub File to active the Synchonisation. 

The other three SubFiles are online Versions, which are using Mirror Sync to automatical Synchronice every half Hour by themself again some few Tables. 

All is working Fine as it is, but now we started to make version Controll vor the Offline SubFile. We wanted to start with the implementation of the new promoted Positibility of creating a File via Mirror Sync, for the Offline Version. 

The Problem is, as soon as we change the Version Number in the Offline File and the Main File, the Three Online Subfiles, recognice the change in the Version Number in the Main File and replace their small files with the Big Main File. 

We looked into the script, but nowhere we can find, where it is looking at the current Version number and comparing it with the other Verison number. Because the best case would be, we could create for each Application their own Version number and change it accordingly in the Script. 

Does someone know where we can find this step in the Mirror Sync Script? So we could change it? Or is ther another way? 

If it is not working to make different Version Numbers, maybe we can somehow knock out the Version number and set the $$DatabaseVersion, but again we cant seem to find this Set Variable in the Script.

 

I hope someone of you can help us. 

System Setup:

Filemaker Server: 21.1.4.401

Filemaker Pro: 22.0.1.29

Mirror Sync 6.6

 

Posted

Hey Martina,

Adam with 360works here, I can shed some light on how the database replacement feature works.

Sensing the database replacement:

During the sync, each database that's getting synced by MirrorSync will send client metadata back to the MirrorSync server; one of those pieces of metadata is the databaseVersion. If the databaseVersion on the Hub is not an empty string, and the databaseVersion on the spoke is different than the hub version, MirrorSync will suggest a database replacement to the user after a successful sync is complete. The comparison is server-side; this is why you couldn't find the code that does this.

How MirrorSync determines which databases to replace (for offline spoke files, not server to server spokes):

When the user confirms that they'd like to replace the database, the MirrorSync script on the spoke will download a "mirrorsyncupdater.fmp12" file into a container and export it to the documents directory. The MirrorSync script will then use Open Url on the script to run its "run" script with a few script parameters. The mirrorsyncupdater.fmp12 file will close the original file, and then it requests a list of databases that need to be replaced from the MirrorSync server.

The list that gets delivered back from the server is composed of two things: first, the main database, and second, the full list of any "additional" databases that were configured to be a part of the sync on one of the very last pages of the configuration wizard.

mirrorsyncupdater will then loop through those filenames and download them from your FileMaker server using the MirrorSync API, and replace the user's original database(s) with the new copies.

To control which databases get replaced here, you can configure the list of databases that are set as "additional databases" in the configuration wizard. This list of additional databases doesn't control how MirrorSync syncs, it only applies in two situations: 1) it controls which databases get downloaded by the MirrorSync "download database" feature, 2) it controls which databases get replaced during version replacements. So you can safely edit this list to remove those other databases without impacting your syncing, and it should stop replacing your additional files. It sounds like you're probably delivering databases to users using some non-MirrorSync method, so hopefully the change to #1 won't present a problem to you.

If you don't want to change that list because you rely on it as your spoke file delivery system, but you still don't want those other files to be replaced, one advanced option is to modify the scripting in the mirrorsyncupdater file. I don't recommend this unless you're well-versed in FileMaker scripting, but in the CreateFileRecords script there's a loop that loops through the list of databases and downloads them, you could just short circuit that loop after the first file successfully downloads; the first file downloaded should always be the "main" file. If you're interested in going this route, the file is named "MirrorSyncLauncher.fmp12" while on the server. Back in version 6.6, it's possible that it was still called "MirrorSyncUpdater.fmp12"; I'm not certain.

If you modify this file, just be aware that this file will be replaced any time you install a new version of MirrorSync, and while most of MirrorSync is very backward-compatible, this script is not (it's not really intended to be modified). Record where you made your changes so you can make them again when the file gets replaced/upgraded.

As of right now, MirrorSync doesn't support different versions of "additional" files. In addition, while it supports "separate mobile files", it doesn't support that for additional databases.

Also: if you experience any problems with the database replacement feature, I highly recommend upgrading to version 7.03+. In the months prior to version 7 rolling out I put a lot of work into eliminating problems with it, as there were known issues with this file up to version 6.70.

I hope all that answers your question! Let me know if you have other questions or want more clarification, I'm happy to help.

 

Adam Brock

360Works Support

[email protected]

770-234-9293

 

 

  • Newbies
Posted

Thank you Adam Brock, 

That clears up why we could not find it. We will take a look at this and make our Changes and see what will happen. We will first try the first suggestion you sent, as this seems a good solution. 

Thank you again for your fast reply!

with best regards 

Martina

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.