668d973889
Incluye: mu-plugins custom (fea-homepage, carta-semana), scripts de migración/traducción/deploy, documentación de auditoría, análisis de cartas y HTML de evangelios exportados desde Joomla. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
100 lines
2.1 KiB
Bash
Executable File
100 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script para extraer los IDs de los artículos de Joomla desde la BD
|
|
|
|
cd ~/joomla-migration/analisis-cartas
|
|
|
|
echo "🔍 Extrayendo IDs de artículos de la base de datos..."
|
|
|
|
# Función para extraer ID del alias (slug)
|
|
extract_id_from_url() {
|
|
echo "$1" | grep -oP '/item/\K[0-9]+'
|
|
}
|
|
|
|
# Crear archivo con todos los IDs
|
|
> todos_los_ids.txt
|
|
|
|
for i in 1 2 3 4; do
|
|
echo "Procesando CARTA $i..."
|
|
|
|
# Extraer IDs de artículos
|
|
while IFS= read -r url; do
|
|
id=$(extract_id_from_url "$url")
|
|
if [ -n "$id" ]; then
|
|
echo "$id" >> todos_los_ids.txt
|
|
fi
|
|
done < carta${i}_articulos.txt
|
|
|
|
# Extraer IDs de multimedia
|
|
while IFS= read -r url; do
|
|
id=$(extract_id_from_url "$url")
|
|
if [ -n "$id" ]; then
|
|
echo "$id" >> todos_los_ids.txt
|
|
fi
|
|
done < carta${i}_multimedia.txt
|
|
done
|
|
|
|
# Eliminar duplicados y ordenar
|
|
sort -u -n todos_los_ids.txt > ids_unicos.txt
|
|
|
|
echo "✅ Total de artículos únicos: $(wc -l < ids_unicos.txt)"
|
|
|
|
# Crear consulta SQL para exportar estos artículos
|
|
cat > consulta_exportar.sql <<'EOF'
|
|
-- Exportar artículos seleccionados de Joomla
|
|
-- Artículos de contenido
|
|
SELECT
|
|
c.id,
|
|
c.title,
|
|
c.alias,
|
|
c.introtext,
|
|
c.fulltext,
|
|
c.created,
|
|
c.created_by,
|
|
c.catid,
|
|
cat.title as category_title,
|
|
c.state,
|
|
c.publish_up,
|
|
c.publish_down,
|
|
c.images,
|
|
c.urls,
|
|
c.attribs,
|
|
c.metadata,
|
|
c.metakey,
|
|
c.metadesc,
|
|
c.language
|
|
FROM ew4r_content c
|
|
LEFT JOIN ew4r_categories cat ON c.catid = cat.id
|
|
WHERE c.id IN (
|
|
EOF
|
|
|
|
# Agregar los IDs
|
|
ids=$(cat ids_unicos.txt | tr '\n' ',' | sed 's/,$//')
|
|
echo " $ids" >> consulta_exportar.sql
|
|
|
|
cat >> consulta_exportar.sql <<'EOF'
|
|
)
|
|
ORDER BY c.created DESC;
|
|
|
|
-- Exportar categorías relacionadas
|
|
SELECT DISTINCT
|
|
cat.id,
|
|
cat.parent_id,
|
|
cat.title,
|
|
cat.alias,
|
|
cat.description,
|
|
cat.path
|
|
FROM ew4r_categories cat
|
|
INNER JOIN ew4r_content c ON cat.id = c.catid
|
|
WHERE c.id IN (
|
|
EOF
|
|
|
|
echo " $ids" >> consulta_exportar.sql
|
|
|
|
cat >> consulta_exportar.sql <<'EOF'
|
|
)
|
|
ORDER BY cat.lft;
|
|
EOF
|
|
|
|
echo "📄 Consulta SQL creada: consulta_exportar.sql"
|