Compartilhar via


Twice as Nice

This document was written by one of my testing colleagues, Randy Stagers, who works on XP Embedded updates as part of the Windows Sustained Engineering group. It explains how to run two Windows XP Embedded databases on the same server using SQL Server 2000 instances. This document is designed to allow users to run both an XPE SP1 and XPE SP2 database on the same server.

1. Install multiple instances of SQL Server.
  NOTE- You need to make sure you have licenses for each instance of SQL Server that you install- to find out about SQL licensing see here.
This doc assumes that there is already a default installation of SQL Server installed that is used to host all other applications that have their own database. Install a new instance of SQL Server to the database machine. You should be asked to name the instance - recommended names are:
SP1 - For XPe SP1
SP2 - For XPe SP2

In total, you should have three instances of SQL server on your machine - a default instance, an SP1 instance and an SP2 instance. NOTE - Apply the appropriate SQL updates and Service Packs to all instances. Make sure all instances are running by using the SQL Service Manager to start any instances that are not running. Instances are referred to by using the following syntax:

server\instance

For example, the SP1 instance on the server MySQLServer is referred to as "MySQLServer\SP1".
 The default instance is simply the server name, "MySQLServer".

2. Install the XPe Tools on the machine.
 This ensures that CMI is on the machine and can access the databases. This step is only required if the XPE tools will be executed on the SQL Server machine.

3. Install SP1 Windows XPe Database on the machine.
This will install the XPE SP1 database into the default instance, and setup the SP1 repository at a default location as well. This can be done from a remote machine as well connecting to the server.

4. Create holding areas for the SP1 and SP2 data files.
Under the Windows Embedded Data folder, create two folders, one called SP1, the other SP2. These will be used to hold the new MDF/LDF files as well as the repositories.

5. Make copies of the XPE SP1 database for use by both instances.
Because the XPE installer has no concept of instances, we need to manually change things around a bit to get the different instances to work properly. To do this, follow these steps:

a. Open Enterprise Manager. Make sure all instances are registered so they can be used.
b. Open the source server and right-click Databases. Select Copy Database Wizard.
c. Use the wizard to copy the MantisSQLDB database from the source to each of the other instances.
i. Put the new MDF/LDF files into the appropriate Windows Embedded Data\SPx folder.
ii. Rename the MDF/LDF files appending SP1 or SP2 as appropriate.

Alternately, you can do this manually:

a. Detach the existing MantisSQLDB database from the default instance using Enterprise Manager.
b. Copy the MDF and LDF into the Windows Embedded Data\SP1 folder.
c. Copy the MDF and LDF into the Windows Embedded Data\SP2 folder.
d. In Enterprise Manager, reattach all DB's to their respective instances

6. Make a copy of the repository files at a separate location (optional)
The repository is where XPE expects to find all the files needed to build a runtime. Because we will have two separate instances on this machine, we can have two separate repository locations as well. This is not necessary, but optional for those who wish to keep their instances entirely separate. Follow these steps:

a. In Explorer, drag and drop the Windows Embedded Data\Repositories folder into the SP1 and SP2 folders. BE SURE TO COPY THE FOLDER, NOT MOVE IT.
b. Share the new SP1 Repositories folder as "SP1Repositories". Give the share R/W permissions for all people who need to update it, R for everyone else.
c. Share the new SP2 Repositories folder as "SP2Repositories". Give the share R/W permissions for all people who need to update it, R for everyone else.

Note that all these operations are COPY, not MOVE.

7. Rebase the repositories.
The location of each repository is held in the database itself, along with the base location for the repositories. These need to be changed to reference the new location of the repositories. Follow these steps for each instance:

a. Open Component Database Manager
b. Click Change to change the default DB
c. Enter "server\SPx" to change to the correct instance
d. Click the Repository tab
e. Click Repository Roots
f. Add the share created in 5c above
g. Delete the default share (should be server\Repositories)
h. Click OK.
h. For each repository in the list
i. Highlight the repository
ii. Click Change Location
iii. Change the share location to the new share created above
iv. Uncheck the "Move repository files to the new location"
v. Click OK.

7. Upgrade to XPE SP2
Follow these steps:

a. Open Component Database Manager
b. Click Change to change the default DB
c. Enter "server\SP2" to change to the SP2 instance. Click OK.
d. Close Component Database Manager
e. Navigate to XPe DISK3 and upgrade your database to SP2 as normal.

8. Apply all XPe updates
You will need to use Component Database Manager to change to the proper instance before applying the SP specific update.

- Lynda