SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
Bestehende WordPress-Seiten
      auf Multisite migrieren
                                     Walter Ebert
       http://www.flickr.com/photos/ifmuth/2690987569/
Walter Ebert

         @wltrd

     walterebert.de

slideshare.net/walterebert
Vorteile von Multisite

●   Nur 1 Server wird benötigt
●   Ein Backend für alle Domains
●   Einheitliche Code-Basis
●   Updates gelten für alle Sites
Nachteile von Multisite

●   Größere Systemabhängigkeit
●   Funktionalitäten müssen sauber umgesetzt
    werden
Voraussetzungen

●   Webserver muss „Rewrite Rules“ unterstützen
●   WordPress muss im Hauptverzeichnis installiert
    sein für Domainunterstützung
Multisite-Konfigurationen
Unterverzeichnisse
  tastywhe.at/01/
  tastywhe.at/zion/
Subdomains
 01.tastywhe.at
 zion.tastywhe.at
Multidomains
  tastywhe.at
  70858.net
Multidomain Setup

WordPress-Setup
●   Neue Installation
●   Vorhandene Installation


Multidomain-Konfiguration
●   Händische Datenbank-Einträge
●   WordPress MU Domain Mapping Plugin
    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/
Multisite aktivieren




Einfügen in wp-config.php:

define( 'WP_ALLOW_MULTISITE', true );
Plugin zwingend laden




Erstelle verzeichnis:
wp-contents/mu-plugins/

Und domain_mapping.php reinkopieren
Domain-Mapping aktivieren

Kopieren:
wp-content/plugins/wordpress-mu-domain-
mapping/sunrise.php

Nach:
wp-content/sunrise.php


Einfügen in wp-config.php:

define( 'SUNRISE', 'on' );
1 VirtualHost für alle Domains



<VirtualHost *:80>
  ServerName 01.tastywhe.at
  ServerAlias zion.tastywhe.at 70858.net
  DocumentRoot /var/www
  <Directory /var/www>
    AllowOverride All
  </Directory>
</VirtualHost>
Pro Domain ohne .htaccess


<VirtualHost *:80>
  ServerName 70858.net
  DocumentRoot /var/www
  <Directory /var/www>
    AllowOverride None
    RewriteEngine On
    RewriteRule ^index.php$ - [L]
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
  </Directory>
</VirtualHost>
Exportmethoden

●   WordPress Export (WXR)
●   MySQL-Dump
MySQL -Dump




mysqldump -u dbuser -p datenbank > dump.sql
Importmethoden

●   WordPress Import (WXR)
●   MySQL
MySQL

mysql -u dbuser -p zion < dump.sql
WordPress-Benutzer

●   Händisch anlegen
●   Während WordPress Import
●   Über MySQL-Dump


Benutzernamen können nur 1 mal vergeben werden
Uploads
wp-content/uploads/
    http://01.tastywhe.at/wp-content/uploads/


wp-content/blogs.dir/2/files/
    http://zion.tastywhe.at/files/


wp-content/blogs.dir/3/files/
    http://70858.net/files/
Über SQL die Uploads anpassen
SET @from_host = '70858.net/wp-content/uploads';
SET @to_host = '70858.net/files';

UPDATE `wp_3_options` SET `option_value` =
  REPLACE(`option_value`, @from_host, @to_host);
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, @from_host,
  @to_host);
UPDATE `wp_3_posts` SET `post_content` =
REPLACE(`post_content`,
  @from_host, @to_host);
UPDATE `wp_3_comments` SET `comment_author_url` =
  REPLACE(`comment_author_url`, @from_host, @to_host);
UPDATE `wp_3_comments` SET `comment_content` =
  REPLACE(`comment_content`, @from_host, @to_host);
UPDATE `wp_3_links` SET `link_url` = REPLACE(`link_url`,
  @from_host, @to_host);
UPDATE `wp_3_postmeta` SET `meta_value` = REPLACE(`meta_value`,
  @from_host, @to_host);
UPDATE `wp_3_commentmeta` SET `meta_value` =
  REPLACE(`meta_value`, @from_host, @to_host);
Uploads nutzen
$uploads = wp_upload_dir();

$uploads['path']
   /var/www/wp-content/blogs.dir/2/files/2011/09
$uploads['url']
   http://zion.tastywhe.at/files/2011/09
$uploads['subdir']
   /files/2011/09
$uploads['baseurl']
  http://zion.tastywhe.at/files
Child Themes
style.css:

/*
Theme Name:     Twenty Eleven Child
Theme URI:      http: //example.com/
Description:    Child theme for the Twenty Eleven theme
Author:         Your name here
Author URI:     http: //example.com/about/
Template:       twentyeleven
Version:        0.1.0
*/
http://codex.wordpress.org/Child_Themes
Statische Dateien

Statische Dateien gelten für alle Domains, z.B.:
●   .htaccess
●   robots.txt
●   sitemap.xml
Kompatibilität

Nutze wp-includes/functions.php, z.B.:
$contents = wp_remote_fopen( $url );

anstatt von:
$contents = file_get_contents( $url );
                             php.ini: allow_url_fopen = On
oder:
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_HEADER, 0 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$contents = curl_exec( $ch );
curl_close( $ch );
                             php.ini: extension=curl.so
Nützliche Variabelen, Funktionen + Konstanten

 ●   is_multisite()
 ●   global $wpdb, $table_prefix;
 ●   bloginfo(), get_bloginfo(),
 ●   plugin_basename(__FILE__);
 ●   plugins_url(), nicht WP_PLUGIN_URL
 ●   WP_PLUGIN_DIR
 ●   content_url(), nicht WP_CONTENT_URL
 ●   WP_CONTENT_DIR

http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
http://codex.wordpress.org/Function_Reference
Links

●   http://codex.wordpress.org/Create_A_Network
●   http://codex.wordpress.org/Determining_Plugin_and_Content_Direc
    tories
●   http://codex.wordpress.org/Function_Reference
●   http://codex.wordpress.org/Child_Themes
●   http://wordpress.org/extend/plugins/wordpress-mu-domain-
    mapping/

Más contenido relacionado

Similar a Bestehende WordPress-Seiten auf Multisite migrieren

DDEV - Eine lokale Entwicklungsumgebung
DDEV - Eine lokale EntwicklungsumgebungDDEV - Eine lokale Entwicklungsumgebung
DDEV - Eine lokale Entwicklungsumgebung
Frank Schmittlein
 
WPDB - das unbekannte Objekt
WPDB -  das unbekannte ObjektWPDB -  das unbekannte Objekt
WPDB - das unbekannte Objekt
frankstaude
 

Similar a Bestehende WordPress-Seiten auf Multisite migrieren (20)

DDEV - Eine lokale Entwicklungsumgebung
DDEV - Eine lokale EntwicklungsumgebungDDEV - Eine lokale Entwicklungsumgebung
DDEV - Eine lokale Entwicklungsumgebung
 
WP-CLI - Das Kommandozeilen Interface für Wordpress
WP-CLI - Das Kommandozeilen Interface für WordpressWP-CLI - Das Kommandozeilen Interface für Wordpress
WP-CLI - Das Kommandozeilen Interface für Wordpress
 
SEO Day 2016: Perfekte Ladezeiten und SEO-Hosting für Speed-Freaks
SEO Day 2016: Perfekte Ladezeiten und SEO-Hosting für Speed-FreaksSEO Day 2016: Perfekte Ladezeiten und SEO-Hosting für Speed-Freaks
SEO Day 2016: Perfekte Ladezeiten und SEO-Hosting für Speed-Freaks
 
WordPress sicherer machen - Basics
WordPress sicherer machen - BasicsWordPress sicherer machen - Basics
WordPress sicherer machen - Basics
 
IPC 2015 Zend Framework 3 Reloaded
IPC 2015 Zend Framework 3 ReloadedIPC 2015 Zend Framework 3 Reloaded
IPC 2015 Zend Framework 3 Reloaded
 
Typo3 und Varnish
Typo3 und VarnishTypo3 und Varnish
Typo3 und Varnish
 
Webanwendungen - Installation, Konfiguration und Administration
Webanwendungen - Installation, Konfiguration und AdministrationWebanwendungen - Installation, Konfiguration und Administration
Webanwendungen - Installation, Konfiguration und Administration
 
WordPress absichern - WP Camp 2012 in Berlin
WordPress absichern - WP Camp 2012 in BerlinWordPress absichern - WP Camp 2012 in Berlin
WordPress absichern - WP Camp 2012 in Berlin
 
Einführung in Docker
Einführung in DockerEinführung in Docker
Einführung in Docker
 
WordPress Professional – SEO Campixx
WordPress Professional – SEO CampixxWordPress Professional – SEO Campixx
WordPress Professional – SEO Campixx
 
WordPress Multisite
WordPress MultisiteWordPress Multisite
WordPress Multisite
 
Wordpress Security
Wordpress SecurityWordpress Security
Wordpress Security
 
WordPress- eine Einführung
WordPress- eine EinführungWordPress- eine Einführung
WordPress- eine Einführung
 
WPDB - das unbekannte Objekt
WPDB -  das unbekannte ObjektWPDB -  das unbekannte Objekt
WPDB - das unbekannte Objekt
 
Entwickeln mit Wordpress
Entwickeln mit WordpressEntwickeln mit Wordpress
Entwickeln mit Wordpress
 
Wordpress on steroids
Wordpress on steroidsWordpress on steroids
Wordpress on steroids
 
FLOW3-Workshop F3X12
FLOW3-Workshop F3X12FLOW3-Workshop F3X12
FLOW3-Workshop F3X12
 
Mehrsprachiges Blog
Mehrsprachiges BlogMehrsprachiges Blog
Mehrsprachiges Blog
 
Word Press Als Blog Und Cms O
Word Press Als Blog Und Cms OWord Press Als Blog Und Cms O
Word Press Als Blog Und Cms O
 
Microservices mit Rust
Microservices mit RustMicroservices mit Rust
Microservices mit Rust
 

Más de Walter Ebert

Más de Walter Ebert (20)

FrOSCon 2023: WordPress als ActivityPub-Instanz
FrOSCon 2023: WordPress als ActivityPub-InstanzFrOSCon 2023: WordPress als ActivityPub-Instanz
FrOSCon 2023: WordPress als ActivityPub-Instanz
 
Hero Video Performance - DrupalCamp Ruhr
Hero Video Performance - DrupalCamp RuhrHero Video Performance - DrupalCamp Ruhr
Hero Video Performance - DrupalCamp Ruhr
 
Sicherheit für WordPress
Sicherheit für WordPressSicherheit für WordPress
Sicherheit für WordPress
 
WordPress aufräumen - WordCamp Stuttgart
WordPress aufräumen - WordCamp StuttgartWordPress aufräumen - WordCamp Stuttgart
WordPress aufräumen - WordCamp Stuttgart
 
WordPress aufräumen
WordPress aufräumenWordPress aufräumen
WordPress aufräumen
 
Hero Video Performance
Hero Video PerformanceHero Video Performance
Hero Video Performance
 
WordPress-Webseiten umziehen / online stellen
WordPress-Webseiten umziehen / online stellenWordPress-Webseiten umziehen / online stellen
WordPress-Webseiten umziehen / online stellen
 
Using browser settings for performance
Using browser settings for performanceUsing browser settings for performance
Using browser settings for performance
 
Das richtige WordPress-Theme finden
Das richtige WordPress-Theme findenDas richtige WordPress-Theme finden
Das richtige WordPress-Theme finden
 
WordPress Health Check - WordCamp Würzburg
WordPress Health Check - WordCamp WürzburgWordPress Health Check - WordCamp Würzburg
WordPress Health Check - WordCamp Würzburg
 
WordPress Health Check
WordPress Health CheckWordPress Health Check
WordPress Health Check
 
Making WordPress fast(er)
Making WordPress fast(er)Making WordPress fast(er)
Making WordPress fast(er)
 
Testumgebungen für WordPress
Testumgebungen für WordPressTestumgebungen für WordPress
Testumgebungen für WordPress
 
Modernism in Web Design
Modernism in Web DesignModernism in Web Design
Modernism in Web Design
 
Weniger aus Bilder holen
Weniger aus Bilder holenWeniger aus Bilder holen
Weniger aus Bilder holen
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
High Performance Images
High Performance ImagesHigh Performance Images
High Performance Images
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's Encrypt
 
WordPress-Templates mit Twig erstellen - PHPUGFFM
WordPress-Templates mit Twig erstellen - PHPUGFFMWordPress-Templates mit Twig erstellen - PHPUGFFM
WordPress-Templates mit Twig erstellen - PHPUGFFM
 
Bilder usw...
Bilder usw...Bilder usw...
Bilder usw...
 

Bestehende WordPress-Seiten auf Multisite migrieren

  • 1. Bestehende WordPress-Seiten auf Multisite migrieren Walter Ebert http://www.flickr.com/photos/ifmuth/2690987569/
  • 2. Walter Ebert @wltrd walterebert.de slideshare.net/walterebert
  • 3. Vorteile von Multisite ● Nur 1 Server wird benötigt ● Ein Backend für alle Domains ● Einheitliche Code-Basis ● Updates gelten für alle Sites
  • 4. Nachteile von Multisite ● Größere Systemabhängigkeit ● Funktionalitäten müssen sauber umgesetzt werden
  • 5. Voraussetzungen ● Webserver muss „Rewrite Rules“ unterstützen ● WordPress muss im Hauptverzeichnis installiert sein für Domainunterstützung
  • 6. Multisite-Konfigurationen Unterverzeichnisse tastywhe.at/01/ tastywhe.at/zion/ Subdomains 01.tastywhe.at zion.tastywhe.at Multidomains tastywhe.at 70858.net
  • 7. Multidomain Setup WordPress-Setup ● Neue Installation ● Vorhandene Installation Multidomain-Konfiguration ● Händische Datenbank-Einträge ● WordPress MU Domain Mapping Plugin http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/
  • 8. Multisite aktivieren Einfügen in wp-config.php: define( 'WP_ALLOW_MULTISITE', true );
  • 9.
  • 10.
  • 11.
  • 12. Plugin zwingend laden Erstelle verzeichnis: wp-contents/mu-plugins/ Und domain_mapping.php reinkopieren
  • 13.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. 1 VirtualHost für alle Domains <VirtualHost *:80> ServerName 01.tastywhe.at ServerAlias zion.tastywhe.at 70858.net DocumentRoot /var/www <Directory /var/www> AllowOverride All </Directory> </VirtualHost>
  • 22. Pro Domain ohne .htaccess <VirtualHost *:80> ServerName 70858.net DocumentRoot /var/www <Directory /var/www> AllowOverride None RewriteEngine On RewriteRule ^index.php$ - [L] RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L] </Directory> </VirtualHost>
  • 23. Exportmethoden ● WordPress Export (WXR) ● MySQL-Dump
  • 24.
  • 25.
  • 26.
  • 27. MySQL -Dump mysqldump -u dbuser -p datenbank > dump.sql
  • 28. Importmethoden ● WordPress Import (WXR) ● MySQL
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. MySQL mysql -u dbuser -p zion < dump.sql
  • 34. WordPress-Benutzer ● Händisch anlegen ● Während WordPress Import ● Über MySQL-Dump Benutzernamen können nur 1 mal vergeben werden
  • 35.
  • 36.
  • 37. Uploads wp-content/uploads/ http://01.tastywhe.at/wp-content/uploads/ wp-content/blogs.dir/2/files/ http://zion.tastywhe.at/files/ wp-content/blogs.dir/3/files/ http://70858.net/files/
  • 38.
  • 39. Über SQL die Uploads anpassen SET @from_host = '70858.net/wp-content/uploads'; SET @to_host = '70858.net/files'; UPDATE `wp_3_options` SET `option_value` = REPLACE(`option_value`, @from_host, @to_host); UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, @from_host, @to_host); UPDATE `wp_3_posts` SET `post_content` = REPLACE(`post_content`, @from_host, @to_host); UPDATE `wp_3_comments` SET `comment_author_url` = REPLACE(`comment_author_url`, @from_host, @to_host); UPDATE `wp_3_comments` SET `comment_content` = REPLACE(`comment_content`, @from_host, @to_host); UPDATE `wp_3_links` SET `link_url` = REPLACE(`link_url`, @from_host, @to_host); UPDATE `wp_3_postmeta` SET `meta_value` = REPLACE(`meta_value`, @from_host, @to_host); UPDATE `wp_3_commentmeta` SET `meta_value` = REPLACE(`meta_value`, @from_host, @to_host);
  • 40.
  • 41. Uploads nutzen $uploads = wp_upload_dir(); $uploads['path'] /var/www/wp-content/blogs.dir/2/files/2011/09 $uploads['url'] http://zion.tastywhe.at/files/2011/09 $uploads['subdir'] /files/2011/09 $uploads['baseurl'] http://zion.tastywhe.at/files
  • 42.
  • 43. Child Themes style.css: /* Theme Name: Twenty Eleven Child Theme URI: http: //example.com/ Description: Child theme for the Twenty Eleven theme Author: Your name here Author URI: http: //example.com/about/ Template: twentyeleven Version: 0.1.0 */ http://codex.wordpress.org/Child_Themes
  • 44. Statische Dateien Statische Dateien gelten für alle Domains, z.B.: ● .htaccess ● robots.txt ● sitemap.xml
  • 45. Kompatibilität Nutze wp-includes/functions.php, z.B.: $contents = wp_remote_fopen( $url ); anstatt von: $contents = file_get_contents( $url ); php.ini: allow_url_fopen = On oder: $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $contents = curl_exec( $ch ); curl_close( $ch ); php.ini: extension=curl.so
  • 46. Nützliche Variabelen, Funktionen + Konstanten ● is_multisite() ● global $wpdb, $table_prefix; ● bloginfo(), get_bloginfo(), ● plugin_basename(__FILE__); ● plugins_url(), nicht WP_PLUGIN_URL ● WP_PLUGIN_DIR ● content_url(), nicht WP_CONTENT_URL ● WP_CONTENT_DIR http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
  • 48. Links ● http://codex.wordpress.org/Create_A_Network ● http://codex.wordpress.org/Determining_Plugin_and_Content_Direc tories ● http://codex.wordpress.org/Function_Reference ● http://codex.wordpress.org/Child_Themes ● http://wordpress.org/extend/plugins/wordpress-mu-domain- mapping/