# Update workflow when I've made changes to the core

**URL:** <https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390>\
**Category:** Developer help\
**Created:** [July 23, 2019, 11:51am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390 "2019-07-23T11:51:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 23, 2019, 11:51am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/1 "2019-07-23T11:51:31Z")

</div>

As I understand ghost CLI makes it easy to update Ghost server & admin client. The cli sets up the following directory structure with a symlink from the `current` to the most up-to-date version:

```
content
current ---------|
versions |
    2.25.8 <--- |

```

When I run `ghost update` I assume the cli will download and add a new version to the `versions` folder and update the symlink:

```
content
current ---------|
versions |
    2.25.8 |
    2.25.9 <----|

```

This makes an update a breath.

However, what if I’ve made changes to the core? This is where things become complicated.

I see two options:

1. The first option is to update through CLI and then manually make changes in the newest core.
2. Second option is to have a clone of the main Ghost core in git and perform merges after the new version is released. In that case I can’t use CLI for update.

What’s the recommended option? Is there an article to read about it? Thanks!

---

<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:** [July 23, 2019, 1:19pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/2 "2019-07-23T13:19:56Z")

</div>

Your understanding of how Ghost updates your instance is spot on. Your assessment that making core changes can be difficult is exactly why it’s not suggested to make core changes, but you’re absolutely correct 🙂

The problem with option 2 is that the git repository is inherently designed to be used for development, not production - for example, the admin client is built in real time, rather than using the bundled version included in the latest release. Your best bet is option 1. You can probably streamline applying your changes by using patches - this article seems to be a good starting point for that:

> **[7 Patch Command Examples to Apply Diff Patch Files in Linux](https://www.thegeekstuff.com/2014/12/patch-command-examples/)**
>
> When there is a security fix available for a particular software, we typically do a binary upgrade using the package management tools like yum or apt-get. But, there might be situation where you have installed a software by compiling it from the...

---

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 24, 2019, 9:36am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/3 "2019-07-24T09:36:50Z")

</div>

Got it, thanks! Then we’ll probably go with the option 1 - manual patching. Do you know if there’s any tests suite that we can use to run our Ghost core against after the merge?

---

<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:** [July 24, 2019, 1:06pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/4 "2019-07-24T13:06:51Z")

</div>

The test suite is stripped from the release zip (since it’s normally not necessary), but you can always grab it from github

---

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 24, 2019, 1:34pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/5 "2019-07-24T13:34:07Z")

</div>

Got it, thanks for your help! We’ll try to go that route and probably will write an article about our journey 🙂

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 24, 2019, 4:30pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/6 "2019-07-24T16:30:16Z")

</div>

Interested to know what changes you’re looking to make in core if you’re willing to share 🙂

---

<div class="post-metadata">

**Author:** ![lmuzquiz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lmuzquiz/32/598_2.png) [@lmuzquiz](https://forum.ghost.org/u/lmuzquiz)\
**Post date:** [July 24, 2019, 11:00pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/7 "2019-07-24T23:00:59Z")

</div>

@Hannah In my case i disable the labs link from the admin, mainly because of the delete all content button. Don’t want an angry or naive admin to delete everything. And sometimes the whole design section, for example when i did the static mega menu then that design section will not work for an admin to add a section to the nav menu, so an admin user will ask why that section its there for him.

---

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 25, 2019, 6:33am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/8 "2019-07-25T06:33:52Z")

</div>

@Hannah sure, we’ll probably customize the core a lot, the big feature will be a membership system, I’ve seen it in the roadmap of Ghost. But at this point we’ll start by implementing `featured` article flag that can only be set by an administrator. This will mark articles featured on the main page. It will be different to `featured` articles marked by authors in that writers make featured articles shown on their stories page, not the landing.

I’m wondering what’s the best place to ask for questions about internals? This forum, github issues?

@lmuzquiz what’s your workflow for updating the core?

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 25, 2019, 9:46am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/9 "2019-07-25T09:46:21Z")

</div>

> [@maxkoretskyi](#):
>
> the big feature will be a membership system, I’ve seen it in the roadmap of Ghost.

Ghost’s own membership system is in active development in core already 😉

> [@maxkoretskyi](#):
>
> I’m wondering what’s the best place to ask for questions about internals? This forum, github issues?

Definitely ask questions here - GitHub is strictly for bugs 🙂

---

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 25, 2019, 10:03am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/10 "2019-07-25T10:03:46Z")

</div>

> [@Hannah](#):
>
> Ghost’s own membership system is in active development in core already 😉
> 
> ![](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/f/faf432e511bc3a65697d092ee40d156cffbb3140.png) maxkoretskyi:

Cool, any rough ETA?

---

<div class="post-metadata">

**Author:** ![lmuzquiz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lmuzquiz/32/598_2.png) [@lmuzquiz](https://forum.ghost.org/u/lmuzquiz)\
**Post date:** [July 26, 2019, 11:27am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/11 "2019-07-26T11:27:23Z")

</div>

@maxkoretskyi i´m more into UI/UX and marketing, i’m no expert on web dev, but here’s basically what i do:

1. Install a previous version of Ghost on my server. Now this version is almost the latest but not the latest. Why? Cause when i upload my modified zipped version of Ghost to the server im gonna use the CLI **ghost update** command (from a zip file) which will not work (i think) if its not a newer version.

2. Install Ghost from source on my local machine  
1.1 Run yarn to update dependencies.

3. Check if it works by running grunt dev  
2.1 Create account & access the admin

4. Make my changes, in this case to some .hbs files for the admin client.

5. Check if changes reflect on the admin

6. After making changes, getting the zip file for the modified version using **grunt release** will almost always certainly throw errors, stopping the release process. So i always have to use the --force. (no pun intended) like this: **grunt release --force**

7. Upload zip file to the versions folder on the server and use this command: **ghost update --zip /path/to/zipfile**

Before running ghost update you might want to do a **ghost doctor**

1. On local machine stash my changes (i don’t do a git branch).

Finished!

Lets say later you want to update the ghost core:

7.1 Run **grunt master** , Apply stash, fix conflicts.

7.2 getting again the zipped version by running grunt release --force (to avoid being stopped by errors).

7.3 Stash changes again.

I think you have to make sure to use the stable branch when doing all this. Not master.

Again, im no expert, Im sure there’s a better way to do all this.

---

<div class="post-metadata">

**Author:** ![maxkoretskyi](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maxkoretskyi](https://forum.ghost.org/u/maxkoretskyi)\
**Post date:** [July 31, 2019, 9:01am UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/12 "2019-07-31T09:01:48Z")

</div>

Thanks for sharing, when we start working on it, I’ll share out workflow

---

<div class="post-metadata">

**Author:** ![tillrahn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tillrahn/32/4587_2.png) [@tillrahn](https://forum.ghost.org/u/tillrahn)\
**Post date:** [February 16, 2020, 12:08pm UTC](https://forum.ghost.org/t/update-workflow-when-ive-made-changes-to-the-core/8390/13 "2020-02-16T12:08:59Z")

</div>

> [@lmuzquiz](#):
>
> Install a previous version of Ghost on my server. Now this version is almost the latest but not the latest. Why? Cause when i upload my modified zipped version of Ghost to the server im gonna use the CLI **ghost update** command (from a zip file) which will not work (i think) if its not a newer version.

If you use the force flag as in **ghost update --force --zip** you won’t need to worry about the versioning, I believe - at least that’s what I’m doing.

> [@lmuzquiz](#):
>
> After making changes, getting the zip file for the modified version using **grunt release** will almost always certainly throw errors, stopping the release process. So i always have to use the --force. (no pun intended) like this: **grunt release --force**

Here I use the skip-tests flag as in **grunt release --skip-tests** to not get the errors.
