====== WordPress Data Refresh ====== Since we have already upgraded the software we can do a dump of the production database and import it in to the new server. To do this cleanly we need to first drop all tables in the WordPress database, import the up-to-date data, set the siteurl, and then visit the main WordPress admin page at /wp-admin and run through the database update again to match the latest release. **NOTE: When we go live the WordPress database needs to be updated again to use the production url for siteurl. ** On penguin: mysqldump -p wordpress > wordpress.sql On lupin: mysqldump -u wordpressusr -pwordpressusrpasswd --add-drop-table --no-data wordpress | grep ^DROP | mysql -u wordpressusr -pwordpressusrpasswd wordpress mysql -u wordpressusr -p wordpress < wordpress.sql Update db to use lupin. mysql -u wordpressusr -p use wordpress; select * from wp_options where option_name='siteurl'; update wp_options set option_value='http://lupin.georgialibraries.org/blog' where option_name='siteurl'; ====== Wordpress Migration ====== Note MySQL 5.1 was not installed/upgraded as expected during lenny-squeeze upgrade only the core was installed. apt-get install mysql-client-5.1 mysql-server-5.1 MySQL backup and restore are examples, use server specific credentials to perform the actions. See WordPress config for more information and perform backup using the same password as we use for daily backups (see crontab). On penguin: tar -sphcvzf ~/wordpress-penguin.tar.gz ./wordpress mysqldump -p wordpress > wordpress.sql On lupin: cd /root/ scp www.open-ils.org:~/wordpress-penguin.tar.gz . mv wordpress wordpress-xxxx-xx-xx tar xvfz wordpress-penguin.tar.gz chown -R www-data.www-data wordpress scp www.open-ils.org:/~/wordpress.sql . mysql -u wordpressusr -p wordpress < wordpress.sql Update db to use lupin. mysql -u wordpressusr -p select * from wp_options where option_name='siteurl'; update wp_options set option_value='http://lupin.georgialibraries.org/blog' where option_name='siteurl'; * Setup crontab entry for mysql backup but did not enable. ===== Upgrade ===== [[http://codex.wordpress.org/Upgrading_WordPress#Manual_Update | Instructions ]] Step 1. wget http://wordpress.org/latest.tar.gz tar xfz latest.tar.gz rm -rf /root/wordpress/wp-includes rm -rf /root/wordpress/wp-admin/ mv wordpress/wp-includes /root/wordpress/ mv wordpress/wp-admin/ /root/wordpress/ mv wordpress/wp-content/index.php /root/wordpress/wp-content/ mv wordpress/wp-content/themes/index.php /root/wordpress/wp-content/themes mv wordpress/wp-content/themes/twentyten /root/wordpress/wp-content/themes mv wordpress/wp-content/plugins/*.php /root/wordpress/wp-content/plugins/ mv wordpress/wp-content/plugins/akismet/* /root/wordpress/wp-content/plugins/akismet/ mv wordpress/* /root/wordpress/ There does not seem to be major changes in the wp-config.php file so backup current file and update the latest one. cp -p /root/wordpress/wp-config.php /root/wordpress/wp-config.php.20110417 cp /root/wordpress/wp-config-sample.php /root/wordpress/wp-config.php vi /root/wordpress/wp-config.php Move the install.php to install.php.disabled mv /root/wordpress/install.php /root/wordpress/install.php.disabled Step 2. Visit your main WordPress admin page at /wp-admin. You may be asked to login again. If a database upgrade is necessary at this point, WordPress will detect it and give you a link. Follow that link and follow the instructions. This will update your database to be compatible with the latest code. You should do this as soon as possible after step 1.