<p>Both the <code>craft/</code> folder name in Craft 2, and the <code>craft</code> executable in Craft 3, can be renamed.</p>

<p>Since the <code>craft</code> executable is user-facing (when SSH’d in), I’d recommend leaving that alone and rename your <code>craft/</code> folder to something else, maybe <code>craft2/</code>. Then in <code>public_html/index.php</code>, update your <code>$craftPath</code> variable to point to the new location:</p>

<pre class="lang-php prettyprint-override"><code>$craftPath = '../craft2';
</code></pre>

CC BY-SA 4.0
2019-08-14T08:38:43.077Z
Thanks Brandon. Obvious now you explain it [self facepalm].
Jonathan Schofield
CC BY-SA 4.0
2019-08-14T09:57:10.747Z
Noting here for others that in Craft 2's `index.php`, `CRAFT_BASE_PATH` is defined as `$craftPath`. At least, it was in mine.
Jonathan Schofield
CC BY-SA 4.0
2019-08-14T14:55:13.350Z
@JonathanSchofield Doh, thanks! Just updated my answer.
Brandon Kelly
CC BY-SA 4.0
2019-08-13T16:41:06.833Z
2019-08-14T14:54:57.910Z
2019-08-14T14:54:57.910Z
Brandon Kelly
<p>I have a Craft 2 installation that I'm upgrading to Craft 3. </p>

<p>I've got v3 running locally in its own virtual host, but now I need to <strong>temporarily</strong> put the dev v3 instance in the same hosting account as the live v2, with the v3 instance resolving at a dev subdomain:</p>

<pre><code>account root
    craft              &lt;-- v2 system
    craft              &lt;-- v3 executable
    config … templates &lt;-- other v3 dependencies
    public_html        &lt;-- live web root
    dev                &lt;-- dev web root
</code></pre>

<p>Given the naming conflict between the v2 system folder and the v3 executable, can I exclude the v3 executable and have v3 still run?</p>

<p>Or can I put all the v3 stuff in its own folder <strong>still above web root</strong> and then tell the dev index.php where to find it? It's not clear to me from <a href="https://docs.craftcms.com/v3/directory-structure.html" rel="nofollow noreferrer">the doc on customising directory structure</a> that I can do that.</p>

<p>I know there is a doc on <a href="https://craftcms.com/guides/moving-craft-files" rel="nofollow noreferrer">moving Craft files</a> but that focuses on moving <em>into</em> web root (in my case, dev web root), which I don't want to do.</p>

<craft3><craft2><configuration>
How to have Craft 3 and 2 on same host?
# How to have Craft 3 and 2 on same host?

(Asked by: username_0 on 2019-08-13)

I have a Craft 2 installation that I'm upgrading to Craft 3. 
I've got v3 running locally in its own virtual host, but now I need to temporarily put the dev v3 instance in the same hosting account as the live v2, with the v3 instance resolving at a dev subdomain:
account root
    craft              <-- v2 system
    craft              <-- v3 executable
    config … templates <-- other v3 dependencies
    public_html        <-- live web root
    dev                <-- dev web root

Given the naming conflict between the v2 system folder and the v3 executable, can I exclude the v3 executable and have v3 still run?
Or can I put all the v3 stuff in its own folder still above web root and then tell the dev index.php where to find it? It's not clear to me from the doc on customising directory structure that I can do that.
I know there is a doc on moving Craft files but that focuses on moving into web root (in my case, dev web root), which I don't want to do.

**Tags:** craft3, craft2, configuration


---

## 1 answers

### Answer by username_1 on 2019-08-13. Score: 3

Both the craft/ folder name in Craft 2, and the craft executable in Craft 3, can be renamed.
Since the craft executable is user-facing (when SSH’d in), I’d recommend leaving that alone and rename your craft/ folder to something else, maybe craft2/. Then in public_html/index.php, update your $craftPath variable to point to the new location:
$craftPath = '../craft2';

> **Comments:**
> **username_0**: Thanks Brandon. Obvious now you explain it [self facepalm].  
> **username_0**: Noting here for others that in Craft 2's `index.php`, `CRAFT_BASE_PATH` is defined as `$craftPath`. At least, it was in mine.  
> **username_1**: @JonathanSchofield Doh, thanks! Just updated my answer.  

---

