Note: This article applies only to SQL Server. When SQLite is used, the data file is stored in the App_Data directory of each web application, so data between web applications is already separated.
Note: You should be comfortable with IIS, SQL Server, have some familiarity with the ASP.NET membership model, and have Visual Studio installed (which has the ASP.NET Configuration Tool required in one of the steps).
Before reading this, you may want to familiarize yourself with the concept of galleries as it applies to Gallery Server Pro by reading the Working With Galleries section in the
Admin Guide.
Gallery Server Pro runs as a web application within IIS where the Gallery ID, stored in galleryserverpro.config, uniquely identifies each web app. By configuring each web app with a unique ID, you can have multiple galleries where all data is stored in the same SQL Server database.
The Admin Guide provides instructions for setting up a second gallery that uses the same set of user accounts as the first gallery. If you want the second gallery to use a separate set of user accounts, yet still keep these accounts in the same database, follow these instructions:
1. Get one instance of Gallery Server running.
2. Copy its files to a new directory and configure it as a web app in IIS. (Don't copy the media files in the mediaobjects directory.)
3. Edit web.config to specify a new applicationName for Membership, Roles, and Profile. This can be anything as long as it is different than the one specified in the first gallery.
4. Edit galleryserverpro.config so that the dataProvider section uses the same applicationName as web.config. (I don't think this is necessary but I include it just to be safe.)
5. Specify a new galleryId in galleryserverpro.config.
6. Use the ASP.NET Configuration Tool that comes with Visual Studio to connect to your site. There should be 0 users and roles. Add a role to represent your sys admin (e.g. 'System Administrator'). Add a user that is a member of this role (e.g. 'Admin').
7. Navigate to the home page of the new gallery. Special startup code will detect the ASP.NET role and add a matching record for it to gs_Role.
8. Use SQL Management Studio to open gs_Role. In the record for the System Administrator role, change AllowAdministerSite to true.
9. Recycle the IIS application pool. This clears out the cache to force the roles to be reloaded from the db at next page load.
10. You should be done! Navigate to the home page and log in. If your original gallery specified an absolute path to your media objects (such as E:\mymedia), you'll want to go to Site admin and change it to a new location. (If it is a relative path such as the default 'mediaobjects', then you don't need to go anything.)
Roger Martin
Creator and Lead Developer of Gallery Server Pro