> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate FlexDeploy to new Server and Database

> This process is useful in many situations, for example, initial proof of concept is completed and production installation needs to be done on differen

This process is useful in many situations, for example, initial proof of concept is completed and production installation needs to be done on different Server and Database.

**These steps are provided as guidelines and extreme care must be taken during such migrations.**

> [!WARNING]
>
> Make sure the source environment is Stopped before proceeding so that we have an accurate copy.

# Export-Import Database

* If you aren’t using the same Database, clone it to the new location.

# Copy the entire FlexDeploy Home, Artifacts folder, and Application folder from the old server to the new one.

You can rm -rf the repos folders first if you like to save space. Something like

```
cd to/the/folder/named/application
rm -rf *repos*
```

You can rm -rf the upgrade\_backups folder to save space. Something like

```
cd $FLEXDEPLOY_HOME
rm -rf upgrade/upgrade_backups
```

You can use streaming gz through ssh to save time and space. Something like

```
tar -czvf - $FLEXDEPLOY_HOME | ssh username@remote_host 'tar -xzvf - -C /u01/flexdeploy'
#usually this contains your artifacts and application. If not, copy them too.
```

If the database url, name, or password has changed, update context.xml. (in the apache-tomcat-flexeploy/conf folder)

If the Java Home has changed, update setenvoverride.sh.(in the apache-tomcat-flexeploy/bin folder)

If the Java Home on the source server had some certificates in it, copy them to the target Java Home.

# Final configuration and start server

* Now start target FlexDeploy and validate it.

* Update System Settings as appropriate.

  * Change FD\_SERVER\_BASE\_URL. (in Settings)

  * Update email settings, possibly need to reauthorize oauth if seeing errors in the logs. (in Settings)
