# Ghost update failed : 2.36 to 3.0 (rollback blocked)

**URL:** <https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788>\
**Category:** Installation\
**Created:** [October 26, 2019, 10:06am UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788 "2019-10-26T10:06:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whys](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@Whys](https://forum.ghost.org/u/Whys)\
**Post date:** [October 26, 2019, 10:06am UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/1 "2019-10-26T10:06:00Z")

</div>

Hi Guys,

I’ve tried to update my ghost blog 2.36.0 to the last release (3.0) but it failed furthermore ghost-cli seems to be unable to rollback 🤔

- Any idea of what’s happened ?
- How to roll back to 2.36.0 and try to update again ?

Thank you in advance for your help !

```auto
OS: Ubuntu, v18.04
Node Version: v10.17.0
Ghost-CLI Version: 1.12.0
Database : Sqlite3

```

**PROCESS**  
**1/ Backup Ghost**  
cp -r content /back/content

**2/ Upgrade Ghost-Cli**  
sudo npm install -g ghost-cli@latest  
ghost-cli@1.12.0

**3/Upgrade Ghost**

```auto
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✔ Checking for latest Ghost version
✔ Downloading and updating Ghost to v3.0.0

Checking theme compatibility for Ghost 3.0.0

✔ Your theme is compatible.

You can also check theme compatibility at https://gscan.ghost.org

? Are you sure you want to proceed with migrating to Ghost 3.0.0? Yes
✔ Updating to a major version
+ sudo systemctl is-active ghost_popfr
+ sudo systemctl stop ghost_popfr
✔ Stopping Ghost
✔ Linking latest Ghost and recording versions
+ sudo systemctl is-active ghost_popfr
☱ Stopping Ghost✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_popfr
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
+ sudo systemctl start ghost_popfr
☱ Restarting Ghost+ sudo systemctl stop ghost_popfr
✖ Restarting Ghost
A GhostError occurred.

Message: Unexpected end of JSON input
Suggestion: journalctl -u ghost_popfr -n 50

Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v10.17.0
    Ghost-CLI Version: 1.12.0
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/ghost/.ghost/logs/ghost-cli-debug-2019-10-26T08_57_07_417Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.

```

**4/RollBack Ghost**

```auto
? Unable to upgrade Ghost from v2.36.0 to v3.0.0. Would you like to revert back to v2.36.0? Yes
+ sudo systemctl is-active ghost_popfr
+ sudo systemctl reset-failed ghost_popfr
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking for available migrations
✔ Checking for latest Ghost version
ℹ Downloading and updating Ghost [skipped]
+ sudo /var/www/pop/current/node_modules/.bin/knex-migrator-rollback --force --v 2.36.0 --mgpath /var/www/pop/current
✖ Rolling back database migrations
A GhostError occurred.

Message: It's not possible to roll back database changes from 3.0.0 to 2.36.0. Please restore from a backup instead

Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v10.17.0
    Ghost-CLI Version: 1.12.0
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/ghost/.ghost/logs/ghost-cli-debug-2019-10-26T08_57_45_829Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.

```

**5/Check logs**

```auto
cat /home/ghost/.ghost/logs/ghost-cli-debug-2019-10-26T08_57_45_829Z.log
Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v10.17.0
    Ghost-CLI Version: 1.12.0
    Environment: production
    Command: 'ghost update'
Message: It's not possible to roll back database changes from 3.0.0 to 2.36.0. Please restore from a backup instead
Stack: Error: It's not possible to roll back database changes from 3.0.0 to 2.36.0. Please restore from a backup instead
    at /usr/lib/node_modules/ghost-cli/lib/tasks/migrator.js:41:21
    at process._tickCallback (internal/process/next_tick.js:68:7)

```

```auto
 ~journalctl -u -n 50
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] WARN Retrying...
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] WARN Tries: 2
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] WARN Retrying...
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
Oct 26 11:40:49 popmv node[3036]: [2019-10-26 09:40:49] ERROR select distinct `posts_meta`.* from `posts_meta` where `posts_meta`.`post_id` in ('5d1251302144500b40
Oct 26 11:40:49 popmv node[3036]: 251302144500b407b7cee', '5d1251302144500b407b7cef', '5d1251302144500b407b7cf0', '5d1251302144500b407b7cf1', '5d1251302144500b407b
Oct 26 11:40:49 popmv node[3036]: b407b83c9', '5d1251302144500b407b83ca', '5d1251302144500b407b83cb', '5d1251302144500b407b83cc', '5d1251302144500b407b83cd', '5d12
Oct 26 11:40:49 popmv node[3036]: 
Oct 26 11:40:49 popmv node[3036]: select distinct `posts_meta`.* from `posts_meta` where `posts_meta`.`post_id` in ('5d1251302144500b407b7617', '5d1251302144500b40
Oct 26 11:40:49 popmv node[3036]: 2144500b407b7cef', '5d1251302144500b407b7cf0', '5d1251302144500b407b7cf1', '5d1251302144500b407b7cf2', '5d1251302144500b407b7cf3'
Oct 26 11:40:49 popmv node[3036]: 83ca', '5d1251302144500b407b83cb', '5d1251302144500b407b83cc', '5d1251302144500b407b83cd', '5d1251302144500b407b83ce', '5d1251302
Oct 26 11:40:49 popmv node[3036]: {"config":{"transaction":true},"name":"11-update-posts-html.js"}
Oct 26 11:40:49 popmv node[3036]: "Error occurred while executing the following migration: 11-update-posts-html.js"
Oct 26 11:40:49 popmv node[3036]: Error ID:
Oct 26 11:40:49 popmv node[3036]: 300
Oct 26 11:40:49 popmv node[3036]: Error Code: 
Oct 26 11:40:49 popmv node[3036]: SQLITE_ERROR
Oct 26 11:40:49 popmv node[3036]: ----------------------------------------
Oct 26 11:40:49 popmv node[3036]: MigrationScriptError: select distinct `posts_meta`.* from `posts_meta` where `posts_meta`.`post_id` in ('5d1251302144500b407b7617
Oct 26 11:40:49 popmv node[3036]: 0b407b7cee', '5d1251302144500b407b7cef', '5d1251302144500b407b7cf0', '5d1251302144500b407b7cf1', '5d1251302144500b407b7cf2', '5d1
Oct 26 11:40:49 popmv node[3036]: '5d1251302144500b407b83ca', '5d1251302144500b407b83cb', '5d1251302144500b407b83cc', '5d1251302144500b407b83cd', '5d1251302144500
lines 1-23...skipping...

```

---

<div class="post-metadata">

**Author:** ![Whys](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@Whys](https://forum.ghost.org/u/Whys)\
**Post date:** [October 28, 2019, 8:24am UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/2 "2019-10-28T08:24:47Z")

</div>

Hi,

I did a rollback (without ghost-cli) to Ghost 2.37.0 !  
I will deploy a fresh instance (3.0) and import my JSON file through the admin panel.🤞 .

---

<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:** [October 28, 2019, 4:39pm UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/3 "2019-10-28T16:39:02Z")

</div>

FYI Rollbacks are deliberately blocked across the major version divide because some of the migrations from 2.x -\> 3.0 change data in ways that can’t be reverted back, so you would potentially lose data.

Our standard advice when an upgrade fails is always to try again with `ghost upgrade --force`.

---

<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:** [October 28, 2019, 4:40pm UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/4 "2019-10-28T16:40:46Z")

</div>

> [@Whys](#):
>
> /home/ghost/.ghost/logs/ghost-cli-debug-2019-10-26T08\_57\_07\_417Z.log

Can you share the log from the original error, rather than from the (expected) rollback failure?

---

<div class="post-metadata">

**Author:** ![Whys](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@Whys](https://forum.ghost.org/u/Whys)\
**Post date:** [October 28, 2019, 4:54pm UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/5 "2019-10-28T16:54:01Z")

</div>

Hi,

@Rollbacks : I wasn’t aware of this behavior, thank for this advice ! 🙂

Of course :

```auto
cat /home/ghost/.ghost/logs/ghost-cli-debug-2019-10-26T08_57_07_417Z.log
Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v10.17.0
    Ghost-CLI Version: 1.12.0
    Environment: production
    Command: 'ghost update'
Message: Unexpected end of JSON input
Suggestion: journalctl -u ghost_popfr -n 50
Stack: Error: Unexpected end of JSON input
    at Server.server.close (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:38:28)
    at Object.onceWrapper (events.js:286:20)
    at Server.emit (events.js:198:13)
    at emitCloseNT (net.js:1619:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)

```

---

<div class="post-metadata">

**Author:** ![Semen\_Lobachevskiy](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/semen_lobachevskiy/32/4980_2.png) [@Semen\_Lobachevskiy](https://forum.ghost.org/u/Semen_Lobachevskiy)\
**Post date:** [November 1, 2019, 8:50pm UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/6 "2019-11-01T20:50:52Z")

</div>

I have the same problem to upgrade from 2.37 to 3.0.2

```
    Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v10.17.0
    Ghost-CLI Version: 1.12.0
    Environment: production
    Command: 'ghost start'
Message: Unexpected end of JSON input
Suggestion: journalctl -u ghost_linuxio-ru -n 50
Stack: Error: Unexpected end of JSON input
    at Server.server.close (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:38:28)
    at Object.onceWrapper (events.js:286:20)
    at Server.emit (events.js:198:13)
    at emitCloseNT (net.js:1619:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
```

---

<div class="post-metadata">

**Author:** ![Whys](https://avatars.discourse-cdn.com/v4/letter/w/3ab097/32.png) [@Whys](https://forum.ghost.org/u/Whys)\
**Post date:** [November 15, 2019, 9:02am UTC](https://forum.ghost.org/t/ghost-update-failed-2-36-to-3-0-rollback-blocked/9788/7 "2019-11-15T09:02:47Z")

</div>

Hi,

After few weeks I’ve decided to retry an upgrade trought “Ghost-Cli” and it works smoothly ! (2.37 to 3.0.3)

Thx 🙂

```auto
sudo npm install -g ghost-cli@latest
+ ghost-cli@1.13.1 

```
