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

# Converting from Upsun Fixed (formerly Platform.sh)

> Learn how to configure your Upsun Fixed app to work on an Upsun Flex project so that it's deployment-ready.

export const VariableBlock = ({name}) => {
  return <var spellCheck={false} title={`Replace '${name}' with your own data`}>{name}</var>;
};

export const ChevronIcon = () => <svg width="24px" height="24px" style={{
  display: 'inline',
  verticalAlign: 'middle'
}}>
    <title id="chevron-icon">Chevron Icon</title>
    <path d="M6.90002 9.8999C6.90002 9.5999 7.00002 9.3999 7.20002 9.1999C7.60002 8.7999 8.20002 8.7999 8.60002 9.1999L12.1 12.6999L15.6 9.1999C16 8.7999 16.6 8.7999 17 9.1999C17.4 9.5999 17.4 10.1999 17 10.5999L12.8 14.7999C12.4 15.1999 11.8 15.1999 11.4 14.7999L7.20002 10.5999C7.00002 10.3999 6.90002 10.1999 6.90002 9.8999Z" fill="current"></path>
  </svg>;

<Warning>
  Upsun Fixed is no longer available as a new offering and has been removed from the product catalog. This guide is intended for **existing Upsun Fixed customers** who want to migrate to Upsun Flex. If you are a new customer, start with [Upsun Flex](/docs/administration/organizations#what-is-an-upsun-flex-organization) directly.
</Warning>

<Note>
  <h4>Important</h4>
  Upsun Fixed and Flex are [**separate products**](/docs/administration/organizations#fixed-and-flex-organizations) with different configuration formats and organizations. You **cannot** mix these configurations in the same project.

  * Upsun Fixed continues to use `.platform/` configuration files.
  * Upsun Flex uses `.upsun/` configuration files.
</Note>

## Before you begin

You need:

* An Upsun Fixed (formerly Platform.sh) application that works and is ready to be built
* The [Upsun CLI](/cli) installed locally

Follow the steps below to begin the conversion of your project.

## 1. Export your source Upsun Fixed project

Start by [exporting everything](/docs/core-concepts/common-tasks/exporting) you might need from your current app.
This includes data in databases, files on a file system,
and for some apps, such as Drupal, configuration that you need to export from the system into files.

## 2. Create a new Upsun project

<Tabs>
  <Tab title="Using the CLI">
    If you do not already have an organization created on Upsun, create one:

    ```bash theme={null}
    upsun org:create
    ```

    Then run the following command to create a project:

    ```bash theme={null}
    upsun project:create
    ```

    When prompted, fill in details like the project name, [region](/docs/development/regions), and the name of your organization.
  </Tab>

  <Tab title="In the Console">
    [Create a new project from scratch](https://console.upsun.com/org/create-project/info).

    If you do not already have an organization created to put the project, you'll first be instructed to create one.

    Once you have done so, select that organization from the dropdown, and select **Create from scratch**.

    In the form, fill in details like the project name and [region](/docs/development/regions).
    You'll be able to define resources for the project after your first push.
  </Tab>
</Tabs>

## 3. Convert your configuration files

There are two ways to change the configuration files of your Upsun Fixed (formerly Platform.sh) projects to make them Upsun compatible.

1. [Convert projects with the CLI](#convert-with-the-cli)
2. [Convert projects manually](#convert-manually)

**Tip:** Regardless of which method you choose, tools are available to make it easier to edit and validate `.upsun/config.yaml` files - check out [this article](https://devcenter.upsun.com/posts/validate-yaml-config/) in the Upsun DevCenter.

<Info>
  <h4>Only one format should exist in your repository</h4>
  Upsun Fixed projects only read configuration files in the `.platform/` folder, while Upsun Flex projects only read configuration files in the `.upsun/` folder. You **cannot mix or combine** these formats. **Only one** should exist in your repository.

  If both `.platform/` and `.upsun/` directories are present, deployment will fail with an error such as:

  ```yaml theme={null}

   E: Error parsing configuration files: No .platform.app.yaml file found anywhere in the repo

  ```
</Info>

### Convert with the CLI

To assist with converting applications from Upsun Fixed (formerly Platform.sh) to Upsun, the Upsun converting tool is available as part of the Upsun CLI.

This feature helps you prepare your existing Upsun Fixed (formerly Platform.sh) configuration for Upsun Flex. This tool should only be used when migrating to an Upsun Flex project. After conversion, remove the `.platform/` folder and files from your repository as Upsun Flex will only read `.upsun/` configuration files.

<Info>
  <h4>Important</h4>
  If you plan to stay on Upsun Fixed, **do not** run this conversion. Fixed projects continue to use `.platform/` files.
</Info>

#### Key functions

The converting tool performs the following transformations:

1. Generation of `.upsun/config.yaml`, which is the primary configuration file for Upsun projects
   * Extracts relevant information from `.platform.app.yaml`, `.platform/applications.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml`.

2. Refactoring of obsolete or incompatible fields
   * Includes the removal of resource-related fields that are not applicable in Upsun, such as:
     * Disk values
     * Size settings (for example, S, M, L)
     * Legacy resources blocks
     * Any deprecated or unsupported container options in the source configuration

3. Adjustments to mounts and storage
   * Converts mounts of type local into Upsun's storage format to support horizontal scaling and infrastructure consistency.
   * Ensures that volumes and file persistence are aligned with how Upsun manages data across containers.

     To learn more, refer to these topics: [`mounts`](/docs/configure-apps/image-properties/mounts) (the property available in the [single-runtime](/docs/configure-apps/image-properties/mounts) and [composable](/docs/configure-apps/image-properties/mounts) images), and [network storage](/docs/add-services/network-storage).

4. Reorganization of custom service configuration
   * Moves custom configuration for [services](/docs/add-services) such as `Solr` into the `.upsun/` directory, which is used to hold project-specific overrides and custom assets.

5. Support for cron jobs
   * Identifies cron jobs defined in Upsun Fixed and provides guidance on how to replicate similar functionality in Upsun.
   * Flags any cron schedules requiring special support and prepares the `.upsun/config.yaml` accordingly.

#### Usage

```bash theme={null}
upsun convert
```

You will be prompted to enter the path to the Upsun Fixed project you would like to convert.

The conversion then takes place within the Upsun CLI and outputs the updated `config.yaml` file to the specified destination directory.

<Warning>
  <h4>Check your organization</h4>
  When converting from Upsun Fixed (formerly Platform.sh) to Upsun Flex, ensure your new Upsun Flex project **belongs to the correct Upsun organization.**

  The conversion **does not** update your organization or hosting plan automatically.
</Warning>

### Convert manually

The [CLI tool described above](#convert-with-the-cli) allows you to convert projects from Upsun Fixed to Upsun, however, if your project has custom requirements that require a more hands-on approach, you can manually update your Upsun Fixed configuration to be compatible with Upsun.

Manual conversion gives you full control over the transition process and can be useful for projects with non-standard setups or advanced customizations.

The exact configuration you want depends on your app. You likely want to configure three areas:

* [The app itself](/docs/configure-apps) -- this is the only required configuration
* [Services](/docs/add-services)
* [Routes](/docs/routes)

When you've added your `.upsun/config.yaml` configuration, make sure to commit it to Git.

## 4. Optional: Define a resource initialization strategy

By default, when you first deploy your project,
Upsun allocates [default resources](/docs/manage-resources/resource-init) to each of your containers.
If you don't want to use those default resources,
define your own [resource initialization strategy](/docs/manage-resources/resource-init#specify-a-resource-initialization-strategy) before pushing your code.

Alternatively, you can [amend those default container resources](/docs/manage-resources/adjust-resources) after your project is deployed.

## 5. Push your changes

The way to push your code to Upsun depends on
whether you're hosting your code with a third-party service using a [source integration](/docs/integrations/source).
If you aren't, your repository is hosted in Upsun
and you can use the CLI or just Git itself.

<Tabs>
  <Tab title="Using the CLI">
    1. Get your project ID by running the following command:

    ```bash theme={null}
    upsun projects
    ```

    2. Add Upsun as a remote repository by running the following command:

    ```bash theme={null}
    upsun project:set-remote <PROJECT_ID>
    ```

    3. Push to the Upsun repository by running the following command:

    ```bash theme={null}
    upsun push
    ```

    When you try to push, any detected errors in your configuration are reported and block the push.
    After any errors are fixed, a push creates a new environment.
  </Tab>

  <Tab title="Using a source integration">
    Set up the integration for your selected service:

    * [Bitbucket](/docs/integrations/source/bitbucket)
    * [GitHub](/docs/integrations/source/github)
    * [GitLab](/docs/integrations/source/gitlab)

    Then push code to that service as you do normally.
    Pushing to a branch creates an environment from that branch.

    Note that the source integration doesn't report any errors in configuration directly.
    You have to monitor those in your project activities.
  </Tab>

  <Tab title="Using Git">
    1. Add an [SSH key](/docs/development/ssh/ssh-keys).
    2. In the Console, open your project and click **Code <ChevronIcon />**.
    3. Click **Git**.
    4. From the displayed command, copy the location of your repository.
       It should have a format similar to the following:

    ```text theme={null}
    abcdefgh1234567@git.eu.upsun.com:abcdefgh1234567.git
    ```

    5. Add Upsun as a remote repository by running the following command:

    ```bash theme={null}
    git remote add upsun <REPOSITORY_LOCATION>
    ```

    6. Push to the Upsun repository by running the following command:

    ```bash theme={null}
    git push -u upsun <DEFAULT_BRANCH_NAME>
    ```

    When you try to push, any detected errors in your configuration are reported and block the push.
    After any errors are fixed, a push creates a new environment.
  </Tab>
</Tabs>

## 6. Import data

Once you have an environment, you can import the data you backed up at step 1.
The exact process may depend on the service you use.

For SQL databases, for example, you can use a version of this command:

```bash theme={null}
upsun sql < <BACKUP_FILE_NAME>
```

For any potential more details, see the [specific service](/docs/add-services).

## 7. Import files

Your app may include content files, meaning files that aren't intended to be part of your codebase so aren't in Git.
You can upload such files to [mounts you created](/docs/configure-apps/image-properties/mounts).
Upload to each mount separately.

Suppose you have the following mounts defined:

```yaml .upsun/config.yaml theme={null}
applications:
 myapp:
   mounts:
     'web/uploads':
       source: local
       source_path: uploads
     'private':
       source: local
       source_path: private
```

`instance` mounts on Upsun are the equivalent of `local` mounts on Platform.sh.
To ensure continuity when converting from Platform.sh to Upsun,
the `local` mount type works as an alias for the `instance` mount type.

However, it is recommended to change the type of your `local` mounts to `instance` or another [supported mount type](/docs/configure-apps/image-properties/mounts#define-a-mount).

For example:

```yaml .upsun/config.yaml theme={null}
applications:
 myapp:
   mounts:
     'web/uploads':
       source: instance
       source_path: uploads
     'private':
       source: instance
       source_path: private
```

Then, to upload your files, run a command similar to the following:

```bash theme={null}
upsun mount:upload --mount web/uploads --source ./uploads
upsun mount:upload --mount private --source ./private
```

Alternatively, you can upload to your mounts using a different [SSH method](/docs/development/file-transfer#transfer-files-using-an-ssh-client).

## Optional: Add variables

If your app requires environment variables to build properly, [add them to your environment](/docs/development/variables/set-variables).

## What's next

Now that your app is ready to be deployed, you can do more:

* [Add a domain](/docs/domains/steps).
* Set up for [local development](/docs/development/local).
* Configure [health notifications](/docs/integrations/notifications).
* For monitoring and profiling, [integrate Blackfire](/docs/observability/application-metrics/blackfire).
