# Converting from Single to Multi-Site

Convert a single-site Statamic project to multi-site with `php please multisite`, or walk through the manual conversion steps.

## Automated Conversion

We recommend using the following command to convert from a single to [multi-site](/multi-site.md) installation:

``` shell
php please multisite
```

## Manual Conversion

If you wish to better understand how to manually convert from a single to multi-site installation, the steps are as follows.

### Enable Multisite Config

First, enable `multisite` in your `config/statamic/system.php`:

``` php
'multisite' => true,
```

### Adding New Sites

Next, you can add new sites through the control panel at `/cp/sites`, or directly in your `resources/sites.yaml` file:

``` yaml
default:
  name: First Site
  url: /
  locale: en_US
second:
  name: Second Site
  url: /second/
  locale: en_US
```

By default, the first site handle is named `default`, but feel free to rename it. This handle will be used below.

### Update Default Site Content

Now you'll need to update your default site content file & folder structure, so that Statamic knows where to find it, now that you've enabled multi-site.

1. For each collection:
    - Move all entries into a directory named after your default site's handle. (eg. `content/collections/blog/*.md` into `content/collections/blog/default/*.md`)
    - Add a `sites` array to the collection's yaml file with each site you want the entries to be available in.
2. For each tree structure:
    - Take the `root` and `tree` variables, and move them in a file in a subdirectory named after your default site's handle. (eg. `content/trees/navigation/pages.yaml` to `content/trees/navigation/default/pages.yaml`)
    - Add a `sites` array to the root structure's yaml file with each site you want the structure to be available in.
3. For each global set:
    - Add a `sites` array to the root global's yaml file with each site you want the global to be available in.

At this point, your content will be available in the default site. You will need to localize each piece of content by following the steps in its respective documentation.

_**Note:** If you don't add the `sites` to the respective container files, the site selector will not be visible in the control panel._

### Clear The Cache

Finally, clear your cache!

``` shell
php artisan cache:clear
```
