[Update] PG4WP 1.1.0rc2
Time for some news about PG4WP.
Hawkix Blog is now running WordPress 2.9.1 using PG4WP 1.1.0rc2
I’ve tagged a 1.1.0rc2 release because I didn’t get much feedback until now.
‘RC’ means it is a Release Candidate, I feel confident about it being stable enough for production use, but it still needs testing.
Please note : error logging is active in this release, but you can disable it in ‘db.php’ that you have to copy in ‘wp-content’.
The ‘readme.txt’ file is up to date about installation, don’t forget to read it.
[UPDATE] Some people asked me were to download this release, so here is the direct link to the zip file in the wordpress plugins directory
English
But where can i download this version? Can’t seem to find it =P
Nevermind, found it on the Wordpress plugin site, under “other versions”. I hope to have some feedback about using this RC on other instalation(and 2.9.1 upgrade)!
Great work! Thanks for the update.
On peut enfin faire tourner wordpress sous postgres !
Je viens de tester la conversion de mon blog – http://blog.hbis.fr – l’installation est OK, mais en tentant de faire un import XML de mes données, j’ai remarqué qu’aucun commentaire n’était affiché alors qu’ils sont bien dans la DB. Est-ce un problème lié à la DB initiale ou est-ce la conversion ?
Voici ce que j’ai dans le log de debug :
Error running :
DELETE FROM wp_postmeta WHERE meta_key = ‘_thumbnail_id’ AND meta_value = 5
—- converted to —-
DELETE FROM wp_postmeta WHERE meta_key = ‘_thumbnail_id’ AND meta_value = 5
—-
ERROR: operator does not exist: text = integer
LINE 1: …postmeta WHERE meta_key = ‘_thumbnail_id’ AND meta_value = 5
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
———————
Je vais pour l’instant voir ce qui ne va pas en DB. Merci pour toute info à ce sujet.
Après examen des tables, j’ai remarqué que le champ “comment_post_ID” de ta table wp_comments n’est pas initialisé, idem pour comment_count dans wp_posts. En les renseignant, les commentaires apparaissent. Avez-vous ce problème lors de l’import XML ?
En fait, l’import xml ne fait pas partie des éléments prioritaires pour l’instant, ce qui signifie simplement que je n’ai jamais testé cette fonctionnalité avec PG4WP.
Tout mon travail est concentré sur l’utilisation de Wordpress avec PostgreSQL à partir d’une installation “neuve”, je suis conscient qu’il y a un certain nombre de lacunes qui seront probablement réglées dans de futures versions.
Merci pour ces informations, elles me seront très utiles lorsque je me mettrais à travailler sur les mécanismes de migration
Oui, je pense que c’est l’import wordpress qui ne reprend pas comme il faut les données… Je te remonte d’autres pépins liés aux permaliens de la forme’/%year%/%monthnum%/%day%/%postname%/’. Par ex l’URL http://dev.blog.hbis.fr/2010/01/26/roundcube-rc_vacation_0-3-2/ ne fonctionne pas :
Error running :
SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM wp_posts WHERE post_date_gmt > 1970
—- converted to —-
SELECT EXTRACT(YEAR FROM min(post_date_gmt)) AS firstyear, EXTRACT(YEAR FROM max(post_date_gmt)) AS lastyear FROM wp_posts WHERE post_date_gmt > 1970
Il faut caster en timestamp donc un to_timestamp (‘1970′) fonctionnerait.
=> $sql = str_replace( “WHERE post_date_gmt > 1970″, “WHERE post_date_gmt > to_timestamp (‘1970′)”, $sql);
Error running :
SELECT “ID” FROM wp_posts WHERE post_name LIKE ’roundcube-rc_vacation_0-3-2%’ AND YEAR(post_date) = 2010 AND MONTH(post_date) = 1 AND DAYOFMONTH(post_date) = 26 AND post_status = ‘publish’
—- converted to —-
SELECT “ID ” FROM wp_posts WHERE post_name ILIKE ’roundcube-rc_vacation_0-3-2%’ AND EXTRACT(YEAR FROM post_date) = 2010 AND EXTRACT(MONTH FROM post_date) = 1 AND DAYOFEXTRACT(MONTH FROM post_date) = 26 AND post_status = ‘publish’
—-
ERROR: syntax error at or near “FROM”
LINE 1: …(MONTH FROM post_date) = 1 AND DAYOFEXTRACT(MONTH FROM post_…
Ton code gère cela, mais le remplacement est mal ordonné.
Bref, voici mon patch :
— driver_pgsql.php 2010-02-01 01:49:18.000000000 +0100
+++ driver_pgsql.php.orig 2010-02-01 01:38:05.000000000 +0100
@@ -134,10 +134,10 @@
$sql = preg_replace( $pattern, ‘ROUND(DATE_PART(\’epoch\’,$1))’, $sql);
$date_funcs = array(
+ ‘YEAR(‘ => ‘EXTRACT(YEAR FROM ‘,
+ ‘MONTH(‘ => ‘EXTRACT(MONTH FROM ‘,
‘DAY(‘ => ‘EXTRACT(DAY FROM ‘,
- ‘DAYOFMONTH(‘ => ‘EXTRACT(DAY FROM ‘,
- ‘MONTH(‘ => ‘EXTRACT(MONTH FROM ‘,
- ‘YEAR(‘ => ‘EXTRACT(YEAR FROM ‘,
+ ‘DAYOFMONTH(‘ => ‘EXTRACT(DAY FROM ‘,
);
$sql = str_replace( ‘ORDER BY post_date DESC’, ‘ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC’, $sql);
@@ -166,9 +166,6 @@
$sql = str_replace( ‘link_url o_url’, ‘link_url AS o_url’, $sql);
$sql = str_replace( ‘link_name o_name’, ‘link_name AS o_name’, $sql);
$sql = str_replace( ‘link_description o_desc’, ‘link_description AS o_desc’, $sql);
-
- // HB : timestamp fix for permalinks
- $sql = str_replace( “post_date_gmt > 1970″, “post_date_gmt > to_timestamp (‘1970′)”, $sql);
} // SELECT
elseif( 0 === strpos($sql, ‘UPDATE’))
{
A toi de voir si y a plus joli.
Peux-tu m’envoyer un mail pour que je puisse t’envoyer directement tout ce que je débusque ?
Comme çà le patch c’est mieux :
— driver_pgsql.php.orig 2010-02-01 01:38:05.000000000 +0100
+++ driver_pgsql.php 2010-02-01 01:49:18.000000000 +0100
@@ -134,10 +134,10 @@
$sql = preg_replace( $pattern, ‘ROUND(DATE_PART(\’epoch\’,$1))’, $sql);
$date_funcs = array(
- ‘YEAR(‘ => ‘EXTRACT(YEAR FROM ‘,
- ‘MONTH(‘ => ‘EXTRACT(MONTH FROM ‘,
‘DAY(‘ => ‘EXTRACT(DAY FROM ‘,
- ‘DAYOFMONTH(‘ => ‘EXTRACT(DAY FROM ‘,
+ ‘DAYOFMONTH(‘ => ‘EXTRACT(DAY FROM ‘,
+ ‘MONTH(‘ => ‘EXTRACT(MONTH FROM ‘,
+ ‘YEAR(‘ => ‘EXTRACT(YEAR FROM ‘,
);
$sql = str_replace( ‘ORDER BY post_date DESC’, ‘ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC’, $sql);
@@ -166,6 +166,9 @@
$sql = str_replace( ‘link_url o_url’, ‘link_url AS o_url’, $sql);
$sql = str_replace( ‘link_name o_name’, ‘link_name AS o_name’, $sql);
$sql = str_replace( ‘link_description o_desc’, ‘link_description AS o_desc’, $sql);
+
+ // HB : timestamp fix for permalinks
+ $sql = str_replace( “post_date_gmt > 1970″, “post_date_gmt > to_timestamp (‘1970′)”, $sql);
} // SELECT
elseif( 0 === strpos($sql, ‘UPDATE’))
{