Ya estamos en otro servidor

Ahora andamos estrenando este servicio por parte de “Dreamhost”.

Este es el servicio de hosting. Después mudaré mis dominios para acá, tal vez no. Pero por ahora, me gusta mi nuevo servidor.

Lo que le extraño al otro es el ASP.Net, y que el otro era una plataforma windows con servidor IIS.

Ahora regresé a mis tiempos de la Universidad, a moverle a Apache en lugar de IIS, PHP en lugar de ASP.Net, y MySql, en lugar de SQL Server.

PHP ya no me gustaba, pero ahora encuentro con mucho agrado que hay muchas bibliotecas que ya incorporan las buenas prácticas de la programación, como Modelo Vista Controlador, y hasta también hay un ORM en PHP.

Por otro lado, wordpress parece estar mejor diseñado que BlogEngine.

Voy lento porque no pude exportar el archivo BlogML.xml para hacerlo de manera automática.

Al intentar exportar el BlogEngine me dio el siguiente error:
‘’, hexadecimal value 0x19, is an invalid character

La neta ni supe, y ya ni le quise investigar, donde estaba el error. Al parecer, no es un error en alguno de sus posts. Parece que el error ocurre con ellos, al formar el XML.

Para poder exportar los posts, usé un archivo CSV, y para generarlo, ejecuté la query en el SQL Managment Studio:


SELECT
ROW_NUMBER() OVER ( ORDER BY [DateCreated]) as ID,
‘”1″‘ as post_author,
‘”‘+CONVERT(varchar(20), [DateCreated],120 )+'”‘ as post_date ,
‘”‘+CONVERT(varchar(20), DATEADD(hour,+6, [DateCreated]),120 )+'”‘ as post_date_gmt,
‘”‘+ REPLACE( REPLACE(PostContent,’\’,’\\’ ),'”‘,’\”‘ )+'”‘ as post_content,
‘”‘+REPLACE( REPLACE(title,’\’,’\\’ ),'”‘,’\”‘ )+'”‘ as post_title,
” as post_excerpt,
‘”publish”‘ as post_status,
‘”open”‘ as comment_status,
‘”open”‘ as ping_status,
” as post_password,
‘”‘+slug+'”‘ as post_name,
” as to_ping,
” as pinged,
‘”‘+CONVERT(varchar(20), [DateModified],120 )+'”‘ as post_modified,
‘”‘+CONVERT(varchar(20), DATEADD(hour,+6, [DateModified]),120 )+'”‘ as post_modified_gmt,
” as post_content_filtered,
‘”0″‘ as post_parent,
‘”‘+’http://www.laperradaonline.com/?p=’+ CAST(ROW_NUMBER() OVER ( ORDER BY [DateCreated]) as nvarchar(10)) +'”‘ as [guid],
‘”0″‘ as menu_order,
‘”post”‘ as post_type,
” as post_mime_type,
‘”0″‘ as comment_count

FROM
[dbo].[be_Posts]
WHERE IsPublished = 1
ORDER BY [DateCreated]

 

 

 

Como dije antes, se guarda en un CSV, el separador de campos lo ponen que sea un punto y coma ( ; ), y el encoding UTF-8. Después, solo se importa en el phpMyAdmin, en la base de datos de su WordPress.

En PhpMyAdmin, hay una sección que dice: “import”, y desde ahí pueden jalar sus datos.

En column names, pongan esto:


ID,post_author,post_date,post_date_gmt,post_content,post_title,post_excerpt,post_status,comment_status,ping_status,post_password,post_name,to_ping,pinged,post_modified,post_modified_gmt,post_content_filtered,post_parent,guid,menu_order,post_type,post_mime_type,comment_count


 

Este otro query es para obtener los comentarios:

SELECT

‘”‘+ CAST( newp.ID as nvarchar(6))+'”‘ as comment_ID,
‘”‘+ CAST( post.[NewID] as nvarchar(6))+'”‘ as comment_post_ID,

‘”‘+ REPLACE( REPLACE(cmt.Author,’\’,’\\’ ),'”‘,’\”‘ ) +'”‘ as comment_author,
‘”‘+REPLACE( REPLACE(cmt.Email,’\’,’\\’ ),'”‘,’\”‘ ) +'”‘ as comment_author_email,
‘”‘+REPLACE( REPLACE(cmt.Website,’\’,’\\’ ),'”‘,’\”‘ ) +'”‘ as comment_author_url,
‘”‘+cmt.Ip+'”‘ as comment_author_IP,
‘”‘+CONVERT(varchar(20), cmt.CommentDate,120 )+'”‘ as comment_date,
‘”‘+CONVERT(varchar(20), DATEADD(hour,+6, cmt.CommentDate),120 )+'”‘ as comment_date_gmt,
‘”‘+REPLACE( REPLACE(cmt.Comment,’\’,’\\’ ),'”‘,’\”‘ ) +'”‘ as comment_content,
‘”0″‘ as comment_karma,
‘”1″‘ as comment_approved,
‘”Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36″‘ as comment_agent,
‘””‘ as comment_type,
case when parentCmt.ID IS NULL then ‘””‘ else ‘”‘+CAST(parentCmt.ID as nvarchar(6))+'”‘ end as comment_parent,
CASE when Email =’caralb77@hotmail.com’ then ‘”1″‘ ELSE ‘”0″‘ END as [user_id]

FROM be_PostComment cmt
INNER JOIN be_Posts post on post.PostID = cmt.PostID
INNER JOIN #NewIndexPost newp ON cmt.PostCommentID = newp.PostCommentID
LEFT JOIN #NewIndexPost parentCmt ON cmt.ParentCommentID = parentCmt.PostCommentID

where cmt.IsSpam=0 and cmt.IsDeleted=0 and ‘pingback’ <> cmt.Email and post.IsPublished = 1
order by cmt.CommentDate

Nombres de las columnas

comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_date_gmt,comment_content,comment_karma,comment_approved,comment_agent,comment_type,comment_parent,user_id

Y con este query, actualizan la cuenta de comentarios de cada post:

UPDATE wp_2dwn4e_posts set wp_2dwn4e_posts.comment_count = (SELECT COUNT(comment_ID) as commentCount FROM wp_2dwn4e_comments WHERE wp_2dwn4e_comments .comment_post_ID =wp_2dwn4e_posts  .ID   )

Ando a la carrera y estoy obviando algunas instrucciones, como por ejemplo que agregué un campo en las tablas de BlogEngine para manejar el nuevo ID.
Ese campo lo estoy llenando con la función “ROW_Number OVER (PARTITION order by date)”, algo así.

One thought on “Ya estamos en otro servidor

  1. Do you love teen hardcore sex? Or when young girls suck cocks until guys cum? Or you like crazy dorm actions with drunk students drink beer and fuck at parties? All of these and much more you will see on this site 18-teen-porn.com. All kinds of teen porn with beautiful girls. Big tits, small tits, shaved and hairy pussies penetrated by cocks, skilled mouths suck dicks and sure with lots of sperm! Have fun with our teen HD videos!
    With a huge variety of quality teen porn, this top notch tube is sure to grant the best adult experiences online. Once you step inside, you get to see a lot of niches and plenty of available HD videos, all carefully selected and with daily updates to keep you aroused. Enjoy an impressive number of amateur teen porn, cam girls gone wild and a whole lot of other categories in one single and very impressive collection of teen videos. Each comes with HD image and the tube’s fantastic streaming speed, something which will surely improve your adult experiences. Only rate teen porn and quality action, girls on fire in the mood to spin large inches of cock into each of their tiny love holes. Barely legal hotties working cock like true pornstars and a huge number of amateurs trying to make it into the big league. Either way you like your porn, this awesome teen tube will provide young flesh and spicy action at any hour. Only exclusive teen porn which is not available on other movie sites or tubes. Quality content with premium action and girls to die for. Enjoy such fantastic content on a tube that’s set to become number one, a tube which will make your delight with a very large variety of niches. Never mind browsing for teen sex on other tubes, this one right here offers a huge variety of movies and what you need for unbelievable experiences.

    http://www.datingnzcougar.info/

Deja un comentario

Tu dirección de correo electrónico no será publicada.