Welcome to http://www.marssoft.de/
 
Tuesday, 11th December 2018 21:32:53 (GMT+1) 

Install Wordpress on Tanabata

* Taken from the instructions here: http://codex.wordpress.org/Installing_WordPress

General mySQL commands
# list mySQL databases
mysql --user='root' --password -e "SHOW DATABASES;"
# show all mySQL users:
mysql --user='root' --password -e "SELECT User FROM mysql.user;"
# backup mySQL databases:
mysqldump --user='root' --password fabelwerk_wp_A | gzip -9 > /tmp/fabelwerk_wp_A.sql.gz
# change a user password:
mysql --user='root' --password -e "SET PASSWORD FOR 'fabelwerk_wp_A'@'localhost' = PASSWORD('<put password here>');"
# DANGEROUS: drop databases that are not used anymore:
#mysql --user='root' --password -e "DROP DATABASE fabelwerk_wp_A;"

For the Page fabelwerk.de

# create a new mysql database:
mysql --user='root' --password -e "CREATE DATABASE fabelwerk_wp_A DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
# create a user for this database:
mysql --user='root' --password -e "CREATE USER 'fabelwerk_wp_A'@'localhost' IDENTIFIED BY '<put password here>';"
# grant required permissions for table:
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON fabelwerk_wp_A.* TO 'fabelwerk_wp_A'@'localhost';"

From the shell, continue with:

ssh tanabata
cd /home/www/de.fabelwerk/pages/
wget --no-check-certificate https://wordpress.org/wordpress-4.0.1.tar.gz

# the next two steps have been used only for validation:
#tar -xzf wordpress-4.0.1.tar.gz
#mv wordpress /tmp/wordpress-4.0.1

# get the backup from Steffen:
mkdir -p /home/www/de.fabelwerk/pages/tmp && cp -pr /home/www/de.fabelwerk/pages/root/wordpress /home/www/de.fabelwerk/pages/tmp/wordpress
cd /home/www/de.fabelwerk/pages/tmp/wordpress/
mkdir -p backwpup_2484f5_2014-11-24_15-10-03
cd ./backwpup_2484f5_2014-11-24_15-10-03/
tar -xzf ../backwpup_2484f5_2014-11-24_15-10-03.tar.gz

# copy the backup over the wordpress-4.0.1 installation directory:
rm -fr /home/www/de.fabelwerk/pages/wordpress-4.0.1
cp -pr /home/www/de.fabelwerk/pages/tmp/wordpress/backwpup_2484f5_2014-11-24_15-10-03 /home/www/de.fabelwerk/pages/wordpress-4.0.1

# restore the database:
mysql --user='root' --password -e "DROP DATABASE fabelwerk_wp_A;"
mysql --user='root' --password -e "CREATE DATABASE fabelwerk_wp_A DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
mysql --user='root' --password -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON fabelwerk_wp_A.* TO 'fabelwerk_wp_A'@'localhost';"
cp /home/www/de.fabelwerk/pages/tmp/wordpress/backwpup_2484f5_2014-11-24_15-10-03/wp209.sql /tmp/wp209.sql
perl -pi -e 's@/www.fabelwerk.de/neue-homepage@/data.fabelwerk.de/neue-homepage@g' /tmp/wp209.sql
perl -pi -e 's@/fabelwerk.de/neue-homepage@/data.fabelwerk.de/neue-homepage@g' /tmp/wp209.sql
perl -pi -e 's@/www.fabelwerk.de/Homepage-Dateien@/data.fabelwerk.de/Homepage-Dateien@g' /tmp/wp209.sql
perl -pi -e 's@/fabelwerk.de/Homepage-Dateien@/data.fabelwerk.de/Homepage-Dateien@g' /tmp/wp209.sql
perl -pi -e 's@127.0.0.1@www.fabelwerk.de@g' /tmp/wp209.sql
perl -pi -e 's@Applications/AMPPS/www/@@g' /tmp/wp209.sql
perl -pi -e 's@\\\\/wp\\\\/@\\\\/@g;s@/wp([^a-zA-Z0-9-])@$1@g' /tmp/wp209.sql
mysql --user='root' --password 'fabelwerk_wp_A' < /tmp/wp209.sql


# adjust the config:
cd /home/www/de.fabelwerk/pages/wordpress-4.0.1/
perl -pi -e "s@'DB_NAME', '.*?'@'DB_NAME', 'fabelwerk_wp_A'@g" wp-config.php
perl -pi -e "s@'DB_USER', '.*?'@'DB_USER', 'fabelwerk_wp_A'@g" wp-config.php
perl -pi -e "s@'DB_COLLATE', '.*?'@'DB_COLLATE', 'utf8_unicode_ci'@g" wp-config.php

# compare the files from backup and original:
diff -wBdqr /tmp/wordpress-4.0.1/ ./
rm -f backwpup_readme.txt
rm -f liesmich.html
rm -f wp209.sql

# set up for apache web server:
ln -s wordpress-4.0.1 /home/www/de.fabelwerk/pages/wordpress-current
sudo chown -R www-data:www-data /home/www/de.fabelwerk/pages/wordpress-4.0.1
sudo chown -R www-data:www-data /home/www/de.fabelwerk/pages/wordpress-current
guides/wordpress.txt · Last modified: 2015/01/04 18:17 by mario