Wordpress: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 55: | Line 55: | ||
# replace the first 2 (non-comment) occurances of $OldDbName with $newDbName | # replace the first 2 (non-comment) occurances of $OldDbName with $newDbName | ||
vim $newDbName.$stamp.sql | vim $newDbName.$stamp.sql | ||
time nice mysql -uroot -p -sNe "DROP DATABASE IF EXISTS $newDbName;" | |||
time nice mysql -uroot -p -sNe "CREATE DATABASE $newDbName; USE $newDbName; SOURCE $oldDbName.$stamp.sql;" | time nice mysql -uroot -p -sNe "CREATE DATABASE $newDbName; USE $newDbName; SOURCE $oldDbName.$stamp.sql;" | ||
time nice mysql -uroot -p -sNe "GRANT ALL ON $newDbName.* TO '$newDbUser'@'localhost' IDENTIFIED BY '$newDbPass'; FLUSH PRIVILEGES;" | time nice mysql -uroot -p -sNe "GRANT ALL ON $newDbName.* TO '$newDbUser'@'localhost' IDENTIFIED BY '$newDbPass'; FLUSH PRIVILEGES;" | ||
Line 69: | Line 70: | ||
# we want to copy files that don't exist yet in our new install dir. if a file exists in both, don't overwrite the new from the old | # we want to copy files that don't exist yet in our new install dir. if a file exists in both, don't overwrite the new from the old | ||
rsync -av --progress --ignore-existing $oldVhostDir/htdocs/wp-content/ $newVhostDir/htdocs/wp-content/ | rsync -av --progress --ignore-existing $oldVhostDir/htdocs/wp-content/ $newVhostDir/htdocs/wp-content/ | ||
# delete unnecessary & empty upgrade dir | |||
rm -rf $newVhostDir/htdocs/wp-content/upgrade | |||
# migrate '3Dmodels' dir, but put it in 'wp-content' for future migrations (the wp upgrade docs migrate this dir already) | |||
rsync -av --progress $oldVhostDir/htdocs/3Dmodels $newVhostDir/htdocs/wp-content/ | |||
# take the old .htaccess; overwrite existing if needed | |||
rsync -av --progress $oldVhostDir/htdocs/.htaccess $newVhostDir/htdocs/ | rsync -av --progress $oldVhostDir/htdocs/.htaccess $newVhostDir/htdocs/ | ||
</pre> | </pre> | ||
[[Category: Software]] | [[Category: Software]] |
Revision as of 16:48, 26 August 2017
Wordpress Plugins
- No Self Pings - remove self pings
- Contact Form 7 - easy to maintain contact form
- Efficient Related Posts - shows related posts by tags
- Enhanced Recent Posts - shows recent posts, can exclude posts from categories
- Like - Facebook like button for posts
- MailChimp Widget - easy and free newsletter by Mailchimp
- Really Simple CAPTCHA - needed for Contact Form 7
- Semisecure Login Reimagined - for more secure login into your Wordpress
- Social Media Widget - Adds links to all of your social media and sharing site as a widget
- W3 Total Cache - for caching (performance)
- XCloner - Backup and Restore - schedule backups with cron jobs
OSE Website - Known Bugs
CLI guides
This section will provide commands to achieve certain actions for managing wordpress
migrate to svn-backed wordpress install
These commands were used to migrate the existing & outdated wordpress installs to a subversion-backed, ephemeral clone of the site. Changes were iterated to these commands documented here as validation by the site owners exposed issues with the upgrades, missing content, etc. Once the clone was validated entirely, the live site could be brought down & confidently updated per the findings with the ephemeral clone.
obi
oldVhostDir=/var/www/html/obi newVhostDir=/var/www/html/obi2 oldDbName=obi_db newDbName=obi2_db newDbUser=obi2_user newDbPass=CHANGEME mkdir -p $newVhostDir/htdocs pushd $newVhostDir/htdocs yum install subversion svn co https://core.svn.wordpress.org/tags/4.8.1 . find $newVhostDir -type d -exec chmod 750 {} \; find $newVhostDIr -type f -exec chmod 640 {} \; chown -R apache:apache $newVhostDir stamp=`date +%Y%m%d_%T` tmpDir=/var/tmp/dbChange.$stamp mkdir $tmpDir chown root:root $tmpDir chmod 0700 $tmpDir pushd $tmpDir time nice mysqldump -uroot -p --all-databases | gzip -c > preBackup.all_databases.$stamp.sql.gz time nice mysqldump -uroot -p --databases $oldDbName > $oldDbName.$stamp.sql cp $oldDbName.$stamp.sql $newDbName.$stamp.sql # replace the first 2 (non-comment) occurances of $OldDbName with $newDbName vim $newDbName.$stamp.sql time nice mysql -uroot -p -sNe "DROP DATABASE IF EXISTS $newDbName;" time nice mysql -uroot -p -sNe "CREATE DATABASE $newDbName; USE $newDbName; SOURCE $oldDbName.$stamp.sql;" time nice mysql -uroot -p -sNe "GRANT ALL ON $newDbName.* TO '$newDbUser'@'localhost' IDENTIFIED BY '$newDbPass'; FLUSH PRIVILEGES;" popd rsync -av --progress $oldVhostDir/wp-config.php $newVhostDir/ chown apache:apache $newVhostDir/wp-config.php chmod 400 $newVhostDir/wp-config.php # change DB_NAME, DB_USER, DB_PASSWORD, WP_HOME, & WP_SITEURL vim $newVhostDir/wp-config.php # we want to copy files that don't exist yet in our new install dir. if a file exists in both, don't overwrite the new from the old rsync -av --progress --ignore-existing $oldVhostDir/htdocs/wp-content/ $newVhostDir/htdocs/wp-content/ # delete unnecessary & empty upgrade dir rm -rf $newVhostDir/htdocs/wp-content/upgrade # migrate '3Dmodels' dir, but put it in 'wp-content' for future migrations (the wp upgrade docs migrate this dir already) rsync -av --progress $oldVhostDir/htdocs/3Dmodels $newVhostDir/htdocs/wp-content/ # take the old .htaccess; overwrite existing if needed rsync -av --progress $oldVhostDir/htdocs/.htaccess $newVhostDir/htdocs/