Thursday, October 18, 2007

Upgrading to 4D v11 SQL From Previous Versions

These are notes on the "Upgrading to 4D v11 SQL" presentation given by Josh Fletcher and Jean-Yves Fock-Hoon of 4D Inc. at 4D Summit 2007

Josh Fletcher and Jean-Yves Fock-Hoon give presentation at 4D Summit 2007

Conversion Check List...
  • Check 4D Version - v6.0 or later can be directly converted.
  • Backup everything.
  • Run 4D Tools and make sure things are as clean as possible.
  • Uninstall components.
  • Check plug-in compatibility and get v11 plug-ins.
  • Ensure sufficient hard drive space! The conversion process will make copies of any data files it modifies.
  • Multi-language data.
The details button on the conversion wizard gives you details on the conversion process - something new for v11. Most of it is informational, but there is one option which disables the startup method, which is useful since there may be problems with the startup.

After the conversion...

All segments in one file
Indexes will be in a *.4DIndy file
There will be a Replaced Files Folder

The files in the Replaced Files Folder are not a fully functional 4D 2004 database (other files are needed).

If you don't have universal binary versions of all your plug-ins, you cannot run in native mode on Intel Macs. The application will startup, the commands will tokenize, but every time you hit a plug-in command you'll get an error. The work around is to do a Get Info... in the Finder and tell it to run under Rosetta.

Components are now databases. There's the 'host database' which is your primary application, and the 'matrix database' which is the component database.

Shared methods are still there (obviously) and the matrix database can call methods in the host database.

Forms are now 'project forms' that are not attached to tables since components can't include tables.

Process variables are not shared, but you can pass pointers to get around this.

Components can't have tables, but they can access host database tables using pointers and 4D commands like Current form table.

Components must be removed before converting the database.

Component databases are just regular databases that you can open like other databases.

If you want to hide the code in compaonent databases, compile the database.

When they say have sufficient disk space realize that data can grow when it's converted to v11.

Single-level subtables are 'preserved' by converting them to tables that subtable code still works on, but things like SEND/RECEIVE RECORD do not support these special subtable records, and you can't create new subtables - it's there for transition purposes only. You do not automatically get all the subrecords when you load the parent record (since they're no longer in the parent record).

If you delete the relation between the subtable table and the parent table all of the subtable command will no longer work. As soon as you delete the relation you'll need to convert to normal table commands.

There's a component you can use that mimics the old SEND/RECEIVE RECORD functionality with subrecords. It was created by ACI Germany.

Multi-level subtables (subtables that contain subtables) are not supported at all. In fact they'll be wiped out completely. You need to deal with these subtables before you convert. The issue is that you have to go back to v6.8 to deal with these subtables. But it shouldn't be a big deal since you couldn't create multi-level subtables since v2, so it's unlikely this is even an issue for you.

The v6.8 "compatibility mode" for menu bars no longer exists to add edit menus if they don't exist. v11 tells you that an edit menu is added to your menu bars, but it will change the menu numbers, so if you've written code that depends on menu numbers and you don't have an edit menu, you'll have problems.

4D and System resources access is forbidden. Custom resource access is unchanged. Migration is strongly suggested.

In converted databases you'll still have *.RSR and *.4DR files and they are loaded, but it doesn't mean you have access to 4D or System resources.

Custom constants are not supported in v11, but custom resource strings for things like language localization are supported. However, there's a plug-in they're providing for custom constants - UserContants.bundle. The plug-in actually makes custom constants easier to use.

Your custom resource files should go in the Resources folder that's next to your structure file. These resouces can include picture files.

There's a new constant, Current Resource Folder, that gives access to the path of the resources folder, which may come in handy...

The syntax for pictures on forms is file:filename.png or file:folder:filename.png.

You should try to migrate away from using custom string resources for language localization to XLIFF. The XLIFF files go in Language.lproj folders (English.lprog, German.lproj, etc.) Those files have the translations for your objects. No code - everything is handled by 4D provided you have the XLIFF files.

Now, if you want to be able to change on the fly you put all the languages in one XLIFF file and do it the old way where you give the language an ID and go from there...

Components get their own resources and they're local to the component, not the host database.

If you want to change the login image put LoginImage.png in your resources folder.

Macros must now be well-formed. The previous macro format is not supported, but your existing macros will be converted.

Things that changed in macros...

// This is an old comment
<!-- This is a v2 comment -->

<>SomeIPVar (old way)
<>SomeIPVar (new way)

In previous versions validate and cancel transaction could modify the selection. This no longer happens. But you get nested transactions.

If you didn't write very good code in 2004 and had


The second START TRANSACTION and the CANCEL TRANSACTION are ignored and the net effect is the records are saved. v11 will treat this bad code differently and the transaction will be cancelled and the records won't be saved.

If you had a one or more deleted records in a set or named selection you wouldn't know it in v2004. Now there's a separate error code for it.

There's a lot that's changed with pictures...
  • There's now native support.
  • Replicated pictures act differently (didn't catch how).
  • QuickTime is not needed, but if you have an existing picture in QuickTime format you can still see an error on Windows when QuickTime isn't available. However, there's now a command that lets you convert to a different format.
Unicode is another area that's changed a lot. After conversion Unicode will be off. Be careful with with extended ASCII - it will act differently under Unicode. This is an issue if you use the Char() function.

The unicode setting for 4D is different than the unicode setting for serving to the web - just be aware they're not the same.

For tab controls you should move to using hiearchical lists. In the past 4D would create a boolean array with the same name plus an underscore as the array controlling the tab control which allowed you to enable/disable tabs. That no longer works, but you can get the same functionality (and more) if you use hierarchical lists.

Self relations are no longer supported.

The trace window settings won't be preserved during conversion (minor).

If you have data in different languages (one language per field), there's a way you can specify which field has which language. If you don't use this method, you'll have problems. Create a text file (multilang.txt) next to the structure file. The syntax is table number; field number; dialect code - one field per line. If you have this is will be used during conversion.

If you have mixed languages in the same field you'll need to separate the languages into different fields.

Labels: , ,

Digg It!  Add to  Add to StumbleUpon  Add to Reddit  Add to Technorati  Add to Furl  Add to Netscape


Post a Comment

Links to this post:

Create a Link

<< Home