Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Friday, September 23, 2011

The show has began!

This will be a several topics post. On one hand, I've moved the blog service to Blogger, mainly because I was tired of managing my own server. I was posting much much less than I expected, and I found excessive and useless to maintain a full-time server.

From there I had two options: wordpress.com or Blogger. I chose Blogger for various reasons: one, I can change the .blogspot.com URL to any other domain name I want (in this case saypatata.com) for free; two, I like much more the Blogger's Android app than the Wordpress one; and three, I found the Blogger's web interface simpler (and I don't need nothing sophisticated).

So you will see various changes on the blog: the interface, you will have to modify the RSS feed (sorry for that ;)), and that I will post mainly in english. Don't worry, there will be an automatic translation widget somewhere on the page.
In Blogger there is nothing to make your blog fully multilingual (or I have not found it), so I've decided to go with only english as it is more appropriate for the topics on this blog (and in the process I also improve my writing xD).

On the other hand, as some of you already know, I've recently started a project with three friends (@JoanCasasC@miquelcdp@miquelpuigr) called VoiceU. We won the third price at the Yahoo's HackU celebrated at the UPC School, we've participated on the Tetuan Valley Starup School. And then we decided that the project deserves more, so we started working on it full time, pushing on in order to launch a great Start-Up from it.
I've quited my job at G&D to fully dedicate myself on the project, and we are really excited and motivated, hoping to launch soon!
So it seems my entrepreneurial journey has just began :)

I hope my blogger life to improve a little bit after all of this changes, but I don't promise anything... ;)
So we'll keep in touch!

Saturday, July 10, 2010

Backup i WordPress 3.0





En el post anterior vaig comentar que m'havia aparegut l'avís d'actualitzar a Wordpress 3.0. Bé, doncs l'altre dia em vaig decidir i vaig aprofitar una tarda d'avorriment per fer-ho. Però no sense abans fer una copia de seguretat de l'anterior instal·lació, ja que mai se sap el que pot passar. Per fer-ho vaig optar per crear un petit shell script per que em fes la feina:
#!/bin/sh 

#Adapt these variables at your needs
DB_PASS=
DB_USER=
DB_NAME=saypatata
DATE=`date +%d-%m-%y_%kh-%Mm`
BACKUP_DIR=/backup/backup_wordpress/${DB_NAME}_${DATE}

# Creating backup directory
mkdir ${BACKUP_DIR}

# Backup the Data base
mysqldump -u ${DB_USER} -p${DB_PASS} --add-drop-database --add-drop-table ${DB_NAME} > ${BACKUP_DIR}/${DB_NAME}.sql

# Backup the wordpress directory
tar czf ${BACKUP_DIR}/saypatata.tgz /var/www/saypatata



Si el voleu aprofitar, haureu de modificar les variables per a que s'adaptin a la vostra configuració de wordpress. Aquest script simplement crea un backup de la base de dades de wordpress i dels seus fitxers al directori que s'indica a 'BACKUP_DIR'. És molt recomanable que el directori on es faci el backup estigui en un disc dur diferent al de la instal·lació de wordpress, i si pot ser en un d'extern, molt millor.

Per restaurar un backup antic, he fet un altre script:
#!/bin/sh 

# Adapt these variables at your needs
DB_USER=
DB_PASS=
DB_NAME=saypatata
DATE=10-07-10_19h-45m
RESTORE_DIR=/backup/backup_wordpress/${DB_NAME}_${DATE}

if [ -d "${RESTORE_DIR}" ]
then
echo "Restoring ${RESTORE_DIR}"
else
echo "${RESTORE_DIR} does not exists! Abort"
exit
fi

if [ -d "${RESTORE_DIR}/${DB_NAME}.sql" ]
then
echo ""
else
echo "${RESTORE_DIR}/${DB_NAME}.sql does not exists! Abort"
exit
fi

if [ -d "${RESTORE_DIR}/saypatata.tgz" ]
then
echo ""
else
echo "${RESTORE_DIR}/saypatata.tgz does not exists! Abort"
exit
fi

# Restore wordpress database
mysql -u ${DB_USER} -p${DB_PASS} -e "drop database if exists ${DB_NAME};"
mysql -u ${DB_USER} -p${DB_PASS} -e "create database ${DB_NAME};"
mysql -u ${DB_USER} -p${DB_PASS} < ${RESTORE_DIR}/${DB_NAME}.sql

# Restore wordpress files
rm -rf /var/www/saypatata/
cd /
tar xzf ${RESTORE_DIR}/saypatata.tgz


Igual que amb l'anterior, haureu de modificar les variables per a que s'adaptin a la vostra configuració. Fixeu-vos que ara la variable 'DATE' no indica la data actual, en lloc d'això, haureu de posar la data del backup que voleu restaurar, amb el mateix format que s'ha creat el directori.
Per a que funcionin correctament, és recomanable que executeu els scripts amb permisos root (sudo).
No son scripts perfectes, ni molt menys a prova d'errors, així que s'han d'utilitzar amb compte. ;)

Un cop fet el backup vaig actualitzar a wordpress 3.0. El primer que es veu a l'entrar a la pàgina d'administració és que s'han canviat lleugerament els colors del lloc, i alguns nous/modificats menús a la barra lateral. També s'ha afegit l'opció d'allotjar varis blogs sota una mateixa instal·lació de wordpress. Els 'custom menus', que vindrien a ser una nova classe de widgets, però encara no he tingut temps de trastejar gaire amb ells.
El problema va sorgir quan vaig voler escriure un nou post, i és que el plugin que faig servir per fer el blog multillengüatge (qTranslate) encara no està preparat per la versió 3.0 de wordpress... Així que no podia escriure en més d'un idioma.
Degut a això vaig decidir tornar a la versió anterior (gràcies al backup xD) i esperar a que s'actualitzi el qTranslate.

Nota: aneu en compte amb el "copiar-pegar", ja que les cometes (") a vegades traeixen.