Skip to content

Instantly share code, notes, and snippets.

@kbingham
Created January 15, 2016 21:31
Show Gist options
  • Save kbingham/3c2431f2a7e6d71c2d4a to your computer and use it in GitHub Desktop.
Save kbingham/3c2431f2a7e6d71c2d4a to your computer and use it in GitHub Desktop.
My simple wordpress blogs run on heroku. Why? Because its free.
However, I recently got an e-mail from heroku informing me that I needed to upgrade from cedar-10 (based on ubuntu-10.04 LTS) to cedar-14 (based on ... ubuntu-14.04 LTS).
This seemed like a reasonable thing to do, and so I jumped in and executed the following as requested:
$ heroku stack:set cedar-14
$ git commit --allow-empty -m "Upgrading to Cedar-14"
$ git push heroku master
Result? A catastrophic failure for my blog. I had been using the heroku wordpress buildpack from mchung (https://github.com/mchung/heroku-buildpack-wordpress)
However, this statically links against libraries available in Ubuntu-10.04 and hence fails now that they have been upgraded.
The solution is actually fairly easy, and involves upgrading to a newer heroku-wordpress solution which uses a native php buildpack instead.
Follow (approximately) the following to upgrade your installation.
cd $(YOUR_LOCAL_HEROKU_WORDPRESS)
# Instruct heroku to upgrade to cedar-14
heroku stack:set cedar-14
# Force heroku to use the PHP buildpack
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-php
# Move your existing 'config' directory to save it for later
mv config old-config
# Add in the new reference repo
git remote add xyu git://github.com/xyu/heroku-wp.git
git fetch xyu
git reset --hard xyu/master
# Now - if you had extra plugins, you'll need to merge them in from 'oldconfig'
cp -ar oldconfig/public/wp-content/{plugins,themes} public/wp-content
git add public/wp-content
git commit -m "Migrate original plugins and themes"
# And finally - we need to update Heroku with our new install (note the -f on the end)
git push heroku master -f
Now you should be able to open up your URL, and login. Its quite likely that as wordpress will have been updated, it will ask to update your database. But all of the components are the same - so with a little bit of luck - it should be a fairly transparent transition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment