Migrate WordPress Blog

I wanted to move my WordPress blog to my Openmediavault server to consolidate my hardware. It use to be that I have this blog on a standalone FreeBSD box.

So what did I do to make this happen? Here are the high level steps that I did.

  1. Prepare the VM.
  2. Move the data.
  3. Run the App.
  • Openmediavault is able to run Docker and also KVM.

I decided to use KVM because I wanted familiarity and I have not have a lot of experience with docker containers. However, I was also successful in migrating my other applications into docker containers ( more on this to follow.)

  • Migrate the data.

I did a database export and copied over my /usr/local/etc and /usr/local/www folders. I imported the data using the mariadb commandline since I have not setup PhpMyAdmin yet. I encountered a snag on the import. It seems that my database will not import unless I did an individual export of the databases. Something to do with the database user conflicts. Another thing with the import is that I have to redo the database users. I had to drop the users, create user, grant privileges, and finally flush privileges.

The configs I had to check the users and groups as well as the root folder (www) and the wp-content.

  • Run the app.

It would have been simpler if I just setup the server the same way. But, I decided to add an NGINX reverse proxy into the mix. I am able to make it work somewhat but ran into an issue when logging into the app.

this is the error I got:

fatal error: uncaught error: call to undefined function ctype_digit() in /usr/local/www/wordpress/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php:244 stack trace: #0 /usr/local/www/wordpress/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-client.php(136): jetpack_signature->sign_request('i9a$fqo@pwxac&o…', 1578694208, 'ldozcjbmxi', 'vbvvpd3yni1/f2m…', 'post', 'https://jetpack…', 'query('jetpack.sso.req…') #3 /usr/local/www/wordpress/wp-content/plugins/jetpack/modules/sso.php(409): jetpack_sso::request_initial_nonce() #4 /usr/local/www/wordpress/wp-content/plugins/jetpack/modules/sso.php(392): jetpack_sso- in /usr/local/www/wordpress/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php on line 244

I googled for days but I could never find any solution on the net. I finally decided to try to uninstall the Jetpack plugin. I had to go to wordpress.com and disconnect my blog. Once , I did that I was able to login. I then was able to update WordPress and re-enable the jetpack plugin. Booyah!!!

Getting “push email” without an Exchange server

For some people, getting their email pushed to their mobile is important. Although the emails from my home email server is not really as important as my work emails, it still is a good learning experience and its fun. 😀

First, one must already have a working email server. I  am not going to discuss that here. My personal setup is a Debian unstable box with Postfix and Dovecot. I set up my imap server with Maildir and virtual users.

Next, if you use a Debian based distro, do not use “d-push” ,the Debian packaged version of Z-Push, because it is old and I ran into a lot of problems getting it to work. Just download the upstream version and you should be fine.

Unpack the downloaded file and follow the “INSTALL” file instructions.

There are 2 config.php file that we have to edit. The main one on the root of the install, we need to add the “BACKEND_PROVIDER”. Since I am using imap, I added “BackendIMAP”.

Screen Shot 2015-03-07 at 11.32.10 AM

 

 

 

The second config.php file is under the backend/imap folder.  I change the port because I am using SSL. The options part I had to do a lot of trial and error, and some research.(5)

Screen Shot 2015-03-07 at 11.30.00 AM

 

 

 

Save both of this files and reload your Apache.  Before setting up your device try to login through the browser. One should get something similar to this screenshot. If not, you need to do more troubleshooting.

Screen Shot 2015-03-07 at 11.59.07 AM

 

 

 

 

References

  1. http://php.net/manual/en/function.imap-open.php
  2. http://z-push.org/
  3. http://z-push.sourceforge.net/phpbb/viewtopic.php?f=2&t=2408&p=8788&hilit=dovecot#p8788
  4. http://doc.zarafa.com/7.0/Administrator_Manual/en-US/html/_zpush.html
  5. https://nickebo.net/setting-up-push-mail-with-dovecot/