# Migrating A SanteDB Server

**Purpose:** You wish to migrate a server from one hosted environment to another or to copy a configuration from one server to another in order to scale up.

**Introduction:** OpenIZ provides scale-out capabilities in which there are chained AMI configuration instances, however there are times when you wish to migrate or "spin-up" a cloned copy of the environment. This article will illustrate how to copy an existing environment to another server.

This article is not recommended for setting up a scale-out deployment (there are better ways of doing this), however is recommended for:

* Migrating from one hosted platform to another
* Copying a staging environment for testing

**Applies To:**

* OpenIZ IMS Server

**Steps:**

*On the source server (the server you're copying from):*

1. Shut down the OpenIZ host process
   * **net stop "OpenIZ Host Process"**
2. Backup the database by following the instructions listed in [HS001 - Backing up IMS server database](https://github.com/mohawkmedic/openiz-knowledge-base/tree/ebda3706cc82d21b6c3de8bb26b1dee9f2f3c392/kb011-backing-up-ims-server-database.html)
3. Navigate to **C:\Program Files (x86)\Mohawk College\OpenIZ**
4. Compress the folder by right clicking and selecting **Send To** > **Compressed Folder** ![](https://raw.githubusercontent.com/santedb/dev-doc/master/.gitbook/assets/hs003-compress.png)
5. This will create an **OpenIZ.zip** file in the **Mohawk College** folder *(you may be asked to place the file on the desktop instead)*   *\*\**

*On the destination server (the server you're copying to):*

1. Restore the database on your target environment by following the instructions listed in [HS001 - Backing up IMS server database](https://github.com/mohawkmedic/openiz-knowledge-base/tree/ebda3706cc82d21b6c3de8bb26b1dee9f2f3c392/kb011-backing-up-ims-server-database.html)
2. Navigate to **C:\Program Files (x86)\Mohawk College** folder (create it if it does not exist)
3. Extract the **OpenIZ.zip** file into the **C:\Program Files (x86)\Mohawk College** folder.
4. Register the service with: **C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil /i "C:\Program Files (x86)\Mohawk College\OpenIZ\openiz.exe"**
5. Start the service with **net start "OpenIZ Host Process"**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.santesuite.org/knowledgebase/sdb-kb/hs003-migrating-an-openiz-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
