| Converting from Version 3 Mac to Version 6 Windows | |
| By Gerald Bailey, ACI Technical support | |
| Technical Note 98-15 |
Technical Notes for 98-05-May 1998
Introduction
This technical note gives the developer a step-by-step guide for converting a Version 3 Macintosh-based 4D application to 4th Dimension or 4D Server Version 6 on Windows.
Requirements
1. Macintosh with current version 3 database application and a CD ROM drive.
| 2. | Windows machine which meets Version 6 System Specifications. |
| 80486 or Pentium processor | |
| 16MB RAM for Windows 95 (Minimum) | |
| 24MB RAM for Windows NT (Minimum) | |
| Color monitor with 16 colors or more |
3. Backup Hardware and Software.
4. A network that supports file sharing between the Mac and PC -OR- media with sufficient capacity to hold the structure and data files. This media must be able to be read by both Macs & PC's. (Such as a Zip or Jazz Disk)
5. 4th Dimension or 4D Server Version 6 for Windows CD ROM.
Create Backups
Perform a complete backup of your structure and data files before making any change to your database. Store the backup on another device such as a tape drive, removable cartridge drive, file server or unmounted hard drive. This way your database can always be restored to its original state if something happens during the conversion process.
Update Externals / Plug-Ins
1. Remove any plug-ins that are stored inside the structure.
2. Replace each plug-in with one that is done in the new Mac4DX and Win4DX plug-in architecture. (ie: Upgrade from any Proc.ext files)
3. Check with the vendor of your plug-in to make sure it is Version 6 compatible.
4. Remove any plug-ins that are not compatible with V6
5. 4D Chart is now built into 4D V6. If you are currently using 4D Chart, remove it.
Run 4D Tools
Compact the version 3 database files:
1. Launch 4D Tools.
2. Choose Compact... from the Utilities menu.
3. Click Save to continue. Your compacted database will be called "DatabaseName2".
NOTE: When the structure has been compacted, 4D Tools will ask you to "Save a data file".
4. Click Save to begin compacting your data file. Your compacted datafile will be called "DatafileName2.data".
NOTE: You will know compacting is finished when the dialog goes away and all disk activity has stopped.
Convert your database to V6 (MacOS)
First, if you don't own 4D Version 6 for Macintosh, install the DEMO Version of 4D Version 6 on your MacOS Computer. This can be accomplished by inserting your V6 CD into your Macintosh and installing 4D V6 on your Mac.
1. Open your newly compacted database with V6 Macintosh. When asked for the serial number, click the "DEMO" button. You will be asked whether or not you want to convert your database.
2. Click the " Convert" button to continue with the conversion process.
IMPORTANT: Click the "Cancel" button when prompted to convert your data file.
3. From the Open Dialog, open your newly converted database (DatabaseName2) while holding
down the Option (Mac) or ALT (Windows) key. This will force 4D to allow you to choose the data
file you wish to use. (Otherwise 4D will convert your non-compacted data file.)
4. Open the data file that was compacted. It will be called "DataFileName2.data"
7. Click the "Convert Data" button when asked to convert your data file.
NOTE: The data conversion will be finished when the dialog goes away and all disk activity has stopped.
Transport your database to Windows
In the Macintosh operating system, every file has two parts: a resource fork and a data fork. The resource fork (which may or may not be used) can contain resources such as Icons, Strings, Cursors, Pictures, etc. The data fork can contain data, if there is data available. A 4D structure file and even a data file can contain both a data fork and a resource fork.
On Windows, there is no such thing as a resource fork. Therefore it it necessary to "split" a Macintosh file into two windows files so that they may reside on a Windows disk. This is accomplished via the 4D Transporter application. As an example, when you use the 4D Transporter on a 4D structure called "MyDB", the structure file becomes two parts: MyDB.4DB and MyDB.rsr.
See the chart below for these and other file name translations:
Tip: Try to adhere to the "DOS 8.3" naming convention. 8 Characters and a 3 letter file extension.
| File | Mac | Windows |
| Structure | DBName | DBName.4DB & DBName.rsr |
| Data | DBName.data | DBName.4DD & DBName.4DR (optional) |
| Mac Externals | proc.ext | proc.esr |
| Mac Plug-ins | ExtName | ExtName.4DX & ExtName.RSR |
| Win Plug-ins | ExtName | ExtName.4DX & ExtName.RSR |
Now that we know what 4D Transporter does, let's put it to use! First we'll transport the structure, then the data file:
1. Drag your V6 converted structure file called "DatabaseName2" on top of the 4D Transporter application. (This is called "Drag Launching") The default Transfer Method should be set to "Mac to PC". For backup safety, it should also be set to "Make a copy first".
2. Click the "Move" button to transport the structure file. You'll end up with a folder called "DatabaseName2.PC". This folder will contain one or more files. Continuing with the example above, the folder will contain a file called "DatabaseName2.4db" and "DatabaseName2.rsr".
3. Copy the "DatabaseName2.PC" folder to the Windows machine via a network or disk media.
4. Delete or Move the "DatabaseName2.PC" folder to another location on the Macintosh hard disk.
5. Repeat steps 1 -3 for the data file and combine all the parts in one folder on the PC.
6. You may now wish to rename the files on the Windows machine to something more meaningful to you. If you should choose to do so, make sure you do not modify the file extensions. Also, make sure that the corresponding data and resource files have the same 8 character name.
Open the database on Windows
1. Make sure you have the Win4DX and/or Mac4DX folders installed in the folder that contains your database structure file on the Windows machine.
2. Open the database on the Windows machine in V6.
3. Begin testing. If all is fine, proceed to step 4; otherwise, restore from your backup and start over.
4. Resume development or deploy.
Summary
This Technical note described how to migrate a database from Version 3.x on the Macintosh to V6 on Windows.
As with any modification made to your database, thorough testing is essential. Test your database in a non-production environment to be sure that everything works correctly. Examine your data. Perform some spot checking to be sure that everything looks in order.
See Also
You may need to make minor coding changes to your database due to differences between version 3 and version 6. See previous technical notes as well as the 4D language reference manual for more information.
4D Tranporter Documentation
Tech note 97-05, Mac2Win, Walt Nelson
Tech note 97-34, Convert to 4D V6, Gerald Bailey