Friday, January 24. 2014
Blog System Updated
During the previous months the blog has been under maintenance, better said, it has been migrated to a recent version of the s9y software. The blog was receiving a lot of spam and I wanted to update it to a recent version in order to have more tools to control it. (I do not know if you have realized that, but the comments have been disabled during the last two or three months.) Besides the blog is hosted in my previous company and managed by some of my ex-colleagues, so the process has been quite slow.
A new debian box was installed to contain the new blog system by the nologin team. During my Christmas vacation I decided to perform the migration process from the old machine to the new one. Finally the blog system is upgraded to a recent s9y version. As usual I am going to document here the complete process just in case I need it to do it again.
The new machine needs the packages to run PHP and all the dependencies for the s9y blog software. The packages were installed in the debian box:
apt-get install libapache2-mod-php5 apt-get install mysql apt-get install php5-mysql apt-get install php5-gd apt-get install imagemagick
A new site for the blog is created in the web server just defining the minimum data which was copied from the previous configuration (the site's name, the document root and where the logs for the site are placed):
cat /etc/apache2/sites-available/<site-name> <VirtualHost
* :80> ServerName <site-name> DocumentRoot "<site-doc-root>" ErrorLog "/var/log/apache2/<site-name>/error.log" CustomLog "/var/log/apache2/<site-name>/access.log" Combined </VirtualHost>The default site is disabled and the new one is enabled. Some modules are also enabled for the correct behavior of the system.
a2dissite default a2ensite <site-name> a2dismod autoindex a2enmod rewrite
Following s9y recommendations the PHP is configured to support greater files. In the configuration /etc/php5/apache2/php.ini the following two properties are modified:
post_max_size = XXM upload_max_filesize = XXM
The database of the current version is backed up from the MySQL database:
mysqldump --databases <s9y_database> > /tmp/s9y_database.sql
And then restored in the new database of the new host (the file was placed in the user home directory):
mysql -u root -p < ~/s9y_database.sql
Finally the database connection user is created using same name and password of the previous installation with full privileges in the migrated database.
create user '<s9y_user>'@'localhost' identified by '<s9y_password>'; grant all privileges on <s9y_database>.
* to '<s9y_user>'@'localhost';Once the database information is in place the complete document root is copied from the old system to the new one. In the previous machine the document directory of the site is archived:
cd <site-doc-root> tar jcvf /tmp/serendipity.tar.bz2
* The archived file is moved to the new system and exploded:
mkdir <site-doc-root> cd <site-doc-root> tar jxvf ~/serendipity.tar.bz2
At this moment the new system is identical to the old one (but with an updated debian box and related packages -PHP, MySQL,...-). The apache can be started and the blog is presented with the same old version.
Now it is the time to upgrade the blog. The new version of s9y is downloaded and placed in the new system. The upgrade process consists in replacing the s9y files with the new ones, in case of my blog:
tar xzvf serendipity-X.X.X.tar.gz cd serendipity cp -r
* <site-doc-root>/rickyepoderi/Now take care of the owners and the permissions of the files (check with the previous system that owners and permissions are correct).
The apache web server is started and the blog is accessed, a upgrade page is shown (the system detects that the software has been upgraded and presents a special page). The page asks to auto-update the system for finishing the process, just clicking the Yes, please do so button the migration is completed.
In my case, the last two points are repeated as many times as blogs are installed in the original web server.
And that is all, my blog is now updated to a recent s9y version. In order to avoid all the spam I was receiving, I decided to change default captchas for the google recaptcha using the specific s9y plugin and disable all the trackbacks. I hope that the blog could now work with comments normally. Apologies for the long time spent doing this process and thanks to my ex-colleagues for their work and time. Finally the blog system is in a good shape.
On the road again!
Comments