# How to rename ghost installation folder

**URL:** <https://forum.ghost.org/t/how-to-rename-ghost-installation-folder/1637>\
**Category:** Developer help\
**Tags:** ghost-cli\
**Created:** [June 17, 2018, 5:10pm UTC](https://forum.ghost.org/t/how-to-rename-ghost-installation-folder/1637 "2018-06-17T17:10:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [June 17, 2018, 7:00pm UTC](https://forum.ghost.org/t/how-to-rename-ghost-installation-folder/1637/2 "2018-06-17T19:00:17Z")

</div>

Changing folders is pretty tricky because every aspect of the installation needs to be updated. Here’s what needs to be done for the recommended stack (Ubuntu 16 + nginx + systemd)

Run these commands as the user that installed Ghost. **I _think_ this is everything you need to do, but I might be missing something.** Think of this post as a living document 😄

Please don’t blindly copy and paste these commands without understanding what they do fully. There’s implicit example information in these commands which could make life harder if you don’t update the command.

These commands are based on migrating from `/var/www/old` to `/var/www/new`

1. Stop your instance

(reset) - `cd ~`

1. Rename the folder

2. Update the global config (`~/.ghost/config`).

3. Update the nginx config

4. Update the systemd config

5. Restart all services

6. Profit 🕶

* * *

# Sed

Sed (stream editor) is a really powerful tool which might be able to make updating these files easier. These commands aren’t bulletproof. Use with caution. If you don’t trust it, the manual version is perfectly acceptable. You might want to make a backup of these files. Here’s the sed command you can run instead of manually editing files (the number corresponds to the step above):

1. (~/.ghost/config) `sed -i ~/.ghost/config -e 's/cwd\": \"\/var\/www\/old/cwd\": \"\/var\/www\/new/'`  
4.a.1 (/path/to/ghost/system/files/ssl-params.conf) `sed -i /path/to/ghost/system/files/ssl-params.conf -e 's/\/var\/www\/old/\/var\/www\/new/'`  
3.b.1 (/path/to/ghost/system/files/example.com-ssl.conf) `sed -i /path/to/ghost/system/files/example.com-ssl.conf -e 's/\/var\/www\/old/\/var\/www\/new/'`  
4.b.2 - nothing (4.b.1 handles it for you!)  
4.c.1 (/path/to/ghost/system/files/example.com.conf) `sed -i /path/to/ghost/system/files/example.com.conf -e 's/\/var\/www\/old/\/var\/www\/new/'`
2. (this is just here to fix formatting)
3. (/path/to/ghost/system/files/name\_example-com.service) `sed -i /path/to/ghost/system/files/name_example-com.service -e 's/\/var\/www\/old/\/var\/www\/new/'`

---

_[View the full topic](https://forum.ghost.org/t/how-to-rename-ghost-installation-folder/1637)._
