Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Wordpress #81

Closed
mitar opened this issue Sep 3, 2016 · 4 comments
Closed

Upgrade Wordpress #81

mitar opened this issue Sep 3, 2016 · 4 comments

Comments

@mitar
Copy link
Member

mitar commented Sep 3, 2016

Upgrade our Wordpress Docker image and then blog image.

@ck2qsuZT
Copy link

Why did we choose Wordpress over Drupal?

@mitar
Copy link
Member Author

mitar commented Nov 15, 2016

I used Drupal in the past. I tried Wordpress and found out that it works better for this simple site. Drupal is even harder to manage. Also Wordpress many people (end users) know how to use.

@mitar
Copy link
Member Author

mitar commented Nov 15, 2016

BTW, our Wordpress installation is pretty safe because Docker images are made in a way that they do not allow Wordpress to write to its own code. This means that updating has to be done through updating Docker images and that autoupdating does not work, but it also means that there is much less chance that some vulnerability is exploited.

@mitar
Copy link
Member Author

mitar commented Nov 15, 2016

I had to do this to update from 4.4.2 to 4.6.1. In the docker-wordpress clone (in /srv/repositories/docker-wordpres on server 2):

cd wordpress
git fetch --tags
git checkout 4.6.1
cd ..
git commit -a

If you are committing on the server, you have to make sure git is configured correctly with who is committing. I simply export:

export GIT_AUTHOR_NAME=Mitar ; export GIT_AUTHOR_EMAIL=... ; export GIT_COMMITTER_NAME=Mitar ; export GIT_COMMITTER_EMAIL=...

You can compile image now locally with docker build -t cloyne/wordpress ., or simply git push and then Docker hub will compile it for you.

Next, we have to update the docker-blog which extends from docker-wordpress image. There are two things one should be upgrading, the theme and plugins. Our theme is based on Twenty Thirteen theme. We use git to help us upgrade. In repository:

cd themes/cloyne # go to theme directory
git log . # see changes made in this repository, and find the latest clean update
git checkout 5d522239cc2094712ae0c23d5b841f7abab98ce2 # this is a commit when we upgraded to clean version 1.7
rm -rf * # removing old version
cp -r /srv/repositories/docker-wordpress/wordpress/wp-content/themes/twentythirteen/* . # copying new version of the theme
git commit -m 'Upgraded to Twenty Thirteen theme, version 2.0.' . # you can get the version of theme in style.css
git checkout master # remember hash of the previous branch
git merge ff6ddda # and resolve conflicts
git add style.css # after resolving a conflict, often this is just reusing old Cloyne theme header with new version
git add footer.php
git commit # to finish merge

git push and build image (docker build -t cloyne/blog .).

Plugins one can update through git submodules, but for two which currently have new versions, git mirror is not updated anymore. We have to decide at some point what to do about that. Maybe use some svn2git tool or something ourselves for them.

To run the new image:

docker stop blog
docker rm blog
./run.sh

After opening cloyne.org, a database update was required. Click and done.

Hopefully all plugins work with new Wordpress version.

Events Manager and WP FullCalendar can be upgraded to a new version.

@mitar mitar closed this as completed Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants