Moving a Model Manager Server Database
You can move the data directories and backup directories of a Model Manager server database using Managed Server Components to another file system location. This is necessary, for example, if you want to keep using the Default managed database automatically set up during installation of a Model Manager server, but the available space on the disk containing the server installation itself is not sufficient.
Moving a Model Manager server database using a managed SQL database server between Windows® and Linux® by copying the data directory or backup directory is not supported due to incompatible storage formats.
New Installation
You can use an existing managed Model Manager server database with a new installation of Model Manager server as follows:
1
See Default Data Directories and Default Backup Directories for the locations of these directories for the default managed database added during installation. You can also find their locations in the System administration area of the Model Manager server web interface — see Managed Server Components for further details.
2
If installed as a Windows® service (default for Windows®), you can stop the Model Manager server service using the Stop Model Manager Server shortcut installed on the Start menu under COMSOL Launchers.
3
You can choose to only include the data directories, in which case the backup directories will be automatically created when the database is added to the new installation. You can also choose to only include the backup directories, in which case the data directories will be automatically restored when the database is added. The latter could also be forced upon you if you, for example, need to restore your database from backup after a complete server disk failure — see also Restore of a Model Manager Server Database.
4
Install Model Manager server. Make sure to select Custom under Add a Model Manager server database in the Server step of the installation to avoid ending up with a new, empty, database.
5
The web interface automatically navigates to the Add Database page as Model Manager server detects that there is no database available.
6
On the Add Database page, write the locations for the data directories and backup directories as specified in step 3. Either of these directories may be empty depending on what you selected to include in step 3. Click Save.
It may take the Model Manager server some time to restore the data directories if only the backup directories were included in step 3. This will be evident by a lack of complete search results on the Home page until the restoration has completed.
Existing Installation
This section contains the necessary steps to move the data directories and backup directories for the Default managed database of an existing Model Manager server installation when that server is run as a Windows® service using the predefined LocalService user account. The new data directories are inside a hypothetical D:\ModelManagerServer root directory and the new backup directories are inside a E:\ModelManagerServerBackup root directory. You can adapt the example by skipping certain steps if you only want to move some of the directories. You can also adapt it by modifying paths if you are running with a different user account, if running on another operating system, or if moving some other Model Manager server database.
Start by creating the parent directories to the new data directories and backup directories via, for example, a system file explorer on the server computer:
1
Create the ModelManagerServer directory on the D drive and the ModelManagerServerBackup directory on the E drive.
Next, deactivate the Model Manager server database via the Model Manager server web interface:
2
On the Database Configurations page in the System administration area, click Default managed database.
3
On The Database Page for the Default managed database, click the Deactivate button.
By deactivating the database, you prevent users from accessing the database via COMSOL Multiphysics or via the Model Manager server web interface while its data directories are being moved.
You will move the directories for each of the three managed server components used by the Default managed database by first stopping the component’s subprocess (if any), moving its directories, updating its configuration, and then starting the subprocess again. For the managed SQL database server:
4
On the Managed SQL Database Servers page in the System administration area, click Default managed PostgreSQL® server.
5
On The Managed SQL Database Server Page for the Default managed PostgreSQL® server, click the Stop button.
The data directory of the managed SQL database server is located inside
C:\Windows\ServiceProfiles\LocalService\AppData\Local\COMSOL\
ModelManager\ManagedDatabases\default-managed
as the data subdirectory. Its backup directory is located inside
C:\Windows\ServiceProfiles\LocalService\AppData\Local\COMSOL\
ModelManager\ManagedDatabases\default-managed-backup
as the data_backup subdirectory.
6
Move the data subdirectory to the ModelManagerServer directory on the D drive so that its new path becomes D:\ModelManagerServer\data.
7
Move the data_backup subdirectory to the ModelManagerServerBackup directory on the E drive so that its new path becomes E:\ModelManagerServerBackup\data_backup.
8
On The Managed SQL Database Server Page for the Default managed PostgreSQL® server, click the Edit button.
9
Write D:\ModelManagerServer\data in the Data directory field.
10
Write E:\ModelManagerServerBackup\data_backup in the Backup directory field.
11
Click the Save button.
12
Click the Start button to start the managed SQL database server.
The data directory and backup directory for the managed resources directory is found next to those of the managed SQL database server as the resources subdirectory and the resources_backup subdirectory respectively.
13
Move the resources subdirectory to the ModelManagerServer directory on the D drive so that its new path becomes D:\ModelManagerServer\resources.
14
Move the resources_backup subdirectory to the ModelManagerServerBackup directory on the E drive so that its new path becomes E:\ModelManagerServerBackup\resources_backup.
15
On the Managed Resources Directories page in the System administration area, click Default managed resources directory.
16
On The Managed Resources Directory Page for the Default managed resources directory, click the Edit button.
17
Write D:\ModelManagerServer\resources in the Data directory field.
18
Write E:\ModelManagerServerBackup\resources_backup in the Backup directory field.
19
Click the Save button.
For the managed search index server:
20
On the Managed Search Index Servers page in the System administration area, click Default managed Apache Solr™ server.
21
On The Managed Search Index Server Page for the Default managed Apache Solr™ server, click the Stop button.
The data directory for the managed search index server is found next to that of the managed SQL database server as the index subdirectory. It has no backup directory.
22
Move the index subdirectory to the ModelManagerServer directory on the D drive so that its new path becomes D:\ModelManagerServer\index.
23
On The Managed Search Index Server Page for the Default managed Apache Solr™ server, click the Edit button.
24
Write D:\ModelManagerServer\index in the Data directory field.
25
Click the Save button.
26
Click the Start button to start the managed search index server.
Finally, activate the Model Manager server database:
27
On The Database Page for the Default managed database, click the Activate button.
The Model Manager server database is now accessible again.