Cardbox > Support > Knowledge Base ...

Upgrading database sharing from Cardbox 2.0

Cardbox 3's way of sharing databases is radically different from earlier versions of Cardbox. Here is a step-by-step guide to converting a Cardbox 2.0 setup to a Cardbox 3 setup with minimal disruption of service. We take things very slowly so that your Cardbox installation continues to work after every step.

The assumed system configuration

To save complication and keep the description simple, we'll assume the following setup:

The network file server is called AGNES.

The folder which contains Cardbox databases on the network file server is called C:\SHARED\CARDBOX.

The folder C:\SHARED on the network file server is shared on the network under the name USERDATA.

From the above information, it follows that from the point of view of a workstation user, the Cardbox databases are stored in \\AGNES\USERDATA\CARDBOX. Some workstation users may have set up a drive letter to refer to \\AGNES\USERDATA, so that the folder which contains the Cardbox databases may appear to them to be something like F:\CARDBOX.

We assume that you have already installed Cardbox 3 before you start.

1. Copy the databases

On the server, create a new folder called something like C:\PRIVATE. (The intention of giving it a name like this is that it should not be visible or accessible from the workstations: you should, however, choose a folder that will be backed up by your normal backup processes).

Copy all the database files from C:\SHARED\CARDBOX to C:\PRIVATE. To do this:

  1. Make sure that no-one is in Cardbox.
  2. Copy all .FMT, .FIL and .FIM files.
  3. Allow everyone back into Cardbox again.

At the end of this stage, you have a copy of the Cardbox databases. All your users can still use Cardbox 2.0 to access the databases in their usual location (\\AGNES\USERDATA\CARDBOX) and they can make changes to the databases if they need to.

2. Tell the Cardbox Server to share the databases

You have two choices here.

In both cases, remember that the location of the database files you are trying to share is C:\PRIVATE and not C:\SHARED\CARDBOX.

At the end of this stage, nothing has changed for your Cardbox 2.0 users. They can still use Cardbox 2.0 to access the databases in their usual location (\\AGNES\USERDATA\CARDBOX) and they can continue to make changes to the databases if they need to.

3. Test database access using Cardbox 3

Now try using Cardbox 3 to open the databases you have shared in step 2. Remember that the way to open those databases is to use File > Open > Server and not File > Open > My Documents. You must not try to open the old copies of the databases in \\AGNES\USERDATA\CARDBOX (or F:\CARDBOX, or whatever it is called). Those old database files are reserved for the Cardbox 2.0 installation, which is still in active use, and if you try opening them then either you will fail or you will prevent anyone else from opening them.

You can try opening databases (the newly copied and shared ones, that is), running macros, and making changes to the databases, but be aware that any changes that you make using Cardbox 3 will be lost later on when you perform the final official copying of the Cardbox 2.0 databases as you are transferring all the users across.

Throughout this stage, At the end of this stage, nothing changes for your Cardbox 2.0 users. They can still use Cardbox 2.0 to access the databases in their usual location (\\AGNES\USERDATA\CARDBOX) and they can continue to make changes to the databases if they need to.

4. Switch over to Cardbox 3

If you are happy with how everything is working with the databases that you copied in step 1, shared in step 2, and tested in step 3, now comes the big moment of change.

Make sure that no-one is in Cardbox

Get everyone out of Cardbox - whether it is Cardbox 2.0 or Cardbox 3. None of the database files must be open or in use by anyone.

Copy the database files

Copy all .FMT, .FIL, and .FIM files from C:\SHARED\CARDBOX to C:\PRIVATE. This will overwrite any changes that you may have made while you were testing Cardbox 3 (we warned you that this would happen), but it will make sure that any changes made by the Cardbox 2.0 users are preserved.

Make the old database files inaccessible

Now that Cardbox 3 is going live, the real copies of the database files are the ones in C:\PRIVATE. The old copies, in C:\SHARED\CARDBOX, are now unreal and therefore dangerous. If anybody accidentally or deliberately opens one of the files in C:\SHARED\CARDBOX then everything will appear to work but there will be a mess: they will not see any of the changes made by the Cardbox 3 users to the real databases, and any changes that they make themselves will not touch the real databases and will therefore be invisible to anyone else.

We don't recommend that you delete anything just yet, but to avoid accidents you need to make the old database files inaccessible. The safest thing is to rename the old database files (for example, rename SALES.FIL to OBSOLETE SALES.FIL), or to stop sharing the folder that contains them, or to move the old database files into an unshared folder on the server.

Get everyone back into Cardbox

At this point no-one should have any more reason to use Cardbox 2.0. For each user, delete any shortcuts to Cardbox 2.0 that you may find, and set up new shortcuts to Cardbox 3.

How we could have done things differently

Not copying the files

If there was no need to ensure continued access while Cardbox was being set up, then we could have avoided all the file copying. It would still have been a good thing to move the files to an unshared folder but there would have been no need to copy twice, once before testing and once after testing.

Using a shared folder for the database files

It would be possible to use a name such as C:\SHARED\NEWCARDBOX for the new copies of the database files, perhaps because your system administrators have a policy about where new folders can be created. From a technical point of view there is no problem with this, but it does make the system vulnerable to human error. If one user forgets about using the server and navigates through the folders, finds the NEWCARDBOX folder, and opens a database there, other people will not be able to open the same database at the same time. This is not disastrous but it is inconvenient, and it is the reason why we recommend that your database files should not be stored in a shared folder.

Rebuilding databases that contain images and objects

The one difference in database format between Cardbox 2.0 and Cardbox 3 concerns databases that contain images or objects: in Cardbox 2.0 these were stored in a separate file (of type .FIM) while in Cardbox 3 they are stored in the main database file. Because of this difference, Cardbox 3 lets you view images and objects but not edit them: in order to make images and objects editable you must rebuild the database with Tools > Management > Rebuild Database. The best time to do this is just after you have copied the files to their new location in Step 4.

© 2016 Martin Kochanski
"Cardbox" is a registered trademark.
 Top of page