Migrating a Database Design

There are three primary methods used to migrate design changes between databasesRefresh Design, Replace Design, and Inherit Design (from an .NTF database). Database changes are often implemented in one database and then migrated to a second database. Any one of these methods can be used to propagate design changes between the development, sandbox, or production database applications. This section describes each of the three migration techniques. You should be familiar with database templates and master design templates (discussed earlier in this chapter) before proceeding.

Refreshing a Database Design

Refresh Design works by copying only design elements that have changed from one database to another. This function compares the time stamp for design objects in the source database with the target database. Any object that contains a newer time stamp in the source database is subsequently updated in the target database. No updates occur for design elements for which the dates match.

The database refresh typically works in conjunction with master design templates where the source database is marked as the master and the target database is marked as the recipient database to inherit design changes. To implement this technique, perform the following steps.

Step 1.

Set the master database properties. Locate the source database and open the database properties. Switch to tab 4, select Database file is a master template, and specify the template name.

Step 2.

Set the target database properties. Locate the database to update and open the database properties. Switch to tab 4, select Inherit design from master template, and specify the exact same template name used from step 1.

Step 3.

Refresh the template. Select the File > Database > Refresh Design menu options. A dialog window will display (see Figure 20.9). Select the Domino server where both the source and target databases reside. Click OK to continue with the process.

Figure 20.9. Refresh a database design

Step 4.

A warning message will be displayed. The message should read

"Refreshing a database design updates views, forms, agents, fields and roles that have been modified in the design template. Do you wish to continue?"

Select Yes to proceed with the design refresh. Lotus Notes will then proceed with the design refresh and update design elements where a newer object resides in the source database to the target database. Alternatively, select No to cancel the design refresh. After the refresh is complete, a status message will be displayed in the message bar of the Lotus Notes client.

Step 5.

Reset the inherit database properties for the target database. To prevent automatic inheritance of design changes (described later in the chapter), open the database properties, switch to tab 4, and uncheck Inherit design from master template.

Replacing a Database Design

When utilizing the Replace Design function, the entire database design is replaced in the target database. Using this approach, all existing design elements in the target database are removed and replaced by the design objects from the source database. This technique can be used to migrate changes between environments or to revert to a previous database version. Reverting to a prior database design is sometimes performed as a means to recover database stability when there are problems with the current database design.

The replace database function is designed to work with database templates. If you recall, database templates are essentially databases that have the .NTF file extension. The design objects associated with this type of file are used as the basis for new or existing databases. To replace a database design, perform the following steps.

Step 1.

Create the database template. Create or make a copy of the database where the file extension is set to .NTF. This database will contain the source design elements to be migrated to the target database.

Step 2.

Make a backup of the current database design. Ensure that a copy of the current database design is available in case you need to revert to the previous design. Use the File > Database > New Copy function and copy only the design.

Step 3.

Select the target database and replace the design. From the Lotus Notes client, select the target database and choose the File > Database > Replace Design menu options. This will display the Replace Database Design dialog box as illustrated in Figure 20.10.

Figure 20.10. Replace the entire database design dialog

Step 4.

Specify the Template Server, which can be either the local workstation or a Domino server, and the corresponding database template (created in step 1).

Step 5.

Click the Replace button to start the process. At this point, a warning message will be displayed. The message should read

"Replacing a database design changes the databases views (except for private ones), forms, agents, fields and roles to match those in the template. Do you wish to proceed?"

Select Yes to proceed with the design replacement. Lotus Notes will then proceed with the design updates by removing all design elements from the target database (with the exception of private views) and applying all design elements from the source database. Alternatively, select No to cancel the design replacement.

Step 6.

After the design replacement is complete, a status message will be displayed in the message bar of the Lotus Notes client.

Note

Changes to the database design generally do not change the data thats already stored in the database. Although design changes may affect how the application works (e.g., the new design may have additional fields, utilize field validation, or include changes to view columns), the underlying data remains unchanged. To revert to a previous database design, simply replace the design with the prior database version.

Automatically Inherit a Database Design

Automatic inheritance of database design changes can be implemented in conjunction with master design templates. Using this approach, design changes from the source database are automatically inherited by the target database each night at 1:00 a.m. (based on the default Domino server configuration setting). Using this approach, the Database file is a master template property is set on the source database, whereas the Inherit design from master template property is set on one or more target databases. Provided that both databases reside on the same server, changes are automatically inherited each night.

Warning

Use caution when setting the Inherit design from master template setting for a database application where the master template and the database application both reside on a Domino server. Typically, design changes will automatically be applied (or inherited) to all database applications at 1:00 a.m. each morning. If you are making changes to the master template but have not completed them before heading home for the day, the changes will automatically be incorporated into the database overnight. Subsequently, this could cause undesirable results in the production database. If changes to the master template are complete, enabling the Inherit design from master template setting will enable the changes to be rolled into the production database overnight and be available to users at the start of the next business day.

To implement this technique, perform the following steps.

Step 1.

Set the master database properties. Locate the source database and open the database properties. Switch to tab 4, select Database file is a master template, and specify the template name.

Step 2.

Set the target database properties. Locate the database to update and open the database properties. Switch to tab 4, select Inherit design from master template, and specify the exact same template name used in step 1.

After they are established, design changes between the source database and the target database(s) will be inherited based on the established time in the Domino server configuration.

Note

Both the master database template (source) and the destination (target) databases must reside on the same Domino server for automatic design inheritance to function. The databases can, however, reside in different folders on the Domino server.

Note

The 1:00 a.m. automatic propagation of changes is the default Domino server setting. The actual time and implementation may vary. Consult your Domino server administrator for more information regarding your server.

Категории

© amp.flylib.com,