Difference between revisions of "User:Aeric/Create a New Branch"

From LongJump Support Wiki
imported>Aeric
 
imported>Aeric
Line 214: Line 214:
#* ISV Release Notes pages
#* ISV Release Notes pages


===Final Housekeeping===
===Clean up and Housekeeping===


# Log in to the server as root
# Log in to the server as root
#:
# From the command line, in the maintenance directory:
# From the command line, in the maintenance directory:
#:* Remove old, deleted images that are taking up space in the archive:
#:* Remove old, deleted images that are taking up space in the archive:
Line 222: Line 223:
#:* Remove versioned copies of images that are taking up space in the archive (Along with other revisions. C'est la vie.).
#:* Remove versioned copies of images that are taking up space in the archive (Along with other revisions. C'est la vie.).
#::* <tt>php deleteArchivedRevisions.php --delete</tt>
#::* <tt>php deleteArchivedRevisions.php --delete</tt>
#:
# Visit phpMyAdmin
# Select the new database
# Select the '''oldimage''' table
# Empty the table to clear the image history

Revision as of 18:44, 2 June 2011

You branch the Wiki to create a sandbox for the next generation of edits. The process is this:

  1. Copy the existing database to a new one (wiki___{next_version})
  2. Install a new version of the wiki at /lj___{next_version}
  3. Adjust the settings to point to the new database.
  4. Make a few other adjustments.

Notepad.png

Note: The installation step is necessary. It pre-configures many paths that are based on the installation directory--paths that are difficult to track down and reconfigure later.

Requirements

  • An ftp app like FileZilla client
  • A text editor like Notepad++
  • An editor you're comfortable using over an SSH connection (vi, in a pinch). Nano is installed on Rackspace, and works reasonably.
  • Access to the internet to get the latest version of MediaWiki
  • A merge program to incorporate edits to LocalSettings.php
    • TortoiseMerge (comes with TSV, works great)
    • WinMerge (free)
  • 7-zip to unzip .tar.gz files to local PC
  • Many free MB on your local hard drive
  • A Wiki-backup and maintenance area on your hard drive. Ex: C:\wwww
  • AdobeIllustrator to modify the LongJump log
  • An icon-file editor to modify the LongJump icon. (See Rename the Wiki.)

Prep Images

In SVN-controlled directory Relationals/techpubs/images/logos:

  1. Edit LJ_Logo.ai with Adobe Illustrator.
    • Change the version number.
    • Export to LJ_Logo_{new_version}.png.
    • Put that under version control
    • Copy it to LJ_Logo.png for use in the Wiki
  2. Create longjump.ico
    • Copy longjump{old_version}.ico to longjump{new_version}.ico
    • Use IcoFX
    • Font: Stencil if available, else Stencil Standard, Normal (not bold)
    • Size: 34 px (font=13pt)
    • Put longjump{new_version}.ico under version control
    • Copy longjump{new_version}.ico to longjump.ico for use in the Wiki
Learn more: Rename the Wiki.

Prep Database

  1. Go to http://ipchicken.com to verify your IP address
  2. Login to the server as root
  3. In /etc/httpd/conf.d/phpMyAdmin.conf,
    In the <Directory /usr/share/phpMyAdmin> section,
    Verify that the IP address is allowed. If it isn't, then add it.
    Note:
    Because we're using a router, each machine in the building appears to have the same (virtual) IP address. So this step should only be needed when coming from some other location.
  4. Visit http://lj.platformatyourservice.com/phpmyadmin
  5. Login (see Aeric, Matt, or Uday for name and password)
  6. Visit the most recent database (e.g. wiki80)
  7. Click Operations
  8. Copy DB To: wiki___{new_version}
  9. Radio button: Structure and data
  10. Checkbox options:
    • Create DB before copying
    • Switch to Copied DB
  11. [Go]
    A message appears at the top of the page saying that the database has been copied.

Prep the Sandbox

Notepad.png

Note: This process parallels the Wiki upgrade process recommended at http://mediawiki.org, but it goes through the installation process to make sure that the internal "script path" settings are configured correctly.

On your local system:

  1. Copy the current wiki:
    C:/www/lj___{curr_version} => C:/www/lj___{next_version}
  2. Rename these files and folders so they're not overwritten by the install:
    • /extensions --> /extensions1
    • /images --> /images1
    • /skins --> /skins1
    • /LocalSettings.php => LocalSettings1.php
  3. Download the latest production version of MediaWiki.
    • Visit Special:Version to find out which version is currently running.
    • Get latest files from
      • http://mediawiki.org
      • Download > Get MediaWiki (.tar.gz)
      • Pick latest production version that has a green checkmark (indicates it is stable)
    • Use 7-Zip to uncompress the files
      • Verify the directory structure (It probably untars to mediawiki-{version}/)
      • Copy the contents to the local instance of the new wiki (ex: C:/www/lj81)
  4. Remove these folders:
    • /extensions
    • /images
    • /skins
  5. Rename these:
    • /extensions1 --> /extensions
    • /images1 --> /images
    • /skins1--> /skins
  6. Rename robots.txt_ALLOW to robots.txt, to turn away search robots.
  7. Copy freshly minted logo and icon files from the SVN repo at Relationals/techpubs/images/logos to skins/lj7monobook in the new wiki:
    • LJ_Logo.png
    • longjump.ico
  8. Zip up the new folder in File Explorer:
    • New > Compressed (Zip) folder
    • Copy the new wiki folder into it
  9. Use ftp/FileZilla to copy it to the hosting server.

On the server:

  1. Login as root
  2. Unzip the zip file:
    • cd /usr/share/mediawiki
    • unzip -a lj___{new_version}
      where -a converts line endings in text files from CR/LF to LF
  3. Make the config/ dir writable for the installation process, and images/ writable to enable uploads:
    • chmod -R a+w config images

Install MediaWiki

  1. From a browser, navigate to:
    http://lj.platformatyourservice.com/lj___{new_version}/index.php
  2. Click set up the wiki.
    (The installation process ensures that PHP scripts which comprise MediaWiki are set up with the correct script path. It's a necessary step, because that value is difficult to retrofit.)
  3. Fill in configuration info:
    • Site config
    • Wiki name: PlatformSupport
    • Contact email: eric@longjump.com --or root@localhost??
    • Language: en - English
    • Copyright/license: No license metadata
    • Admin username/password:
      __TBD: values to use__
    • Object caching: No caching
      (Unless and until memcached ("Memcache-D: The memory caching daemon) is installed and server addresses can be provided.)
    • Email config
    • Email features (global): Enabled
    • User-to-user email: Disabled
    • Email notification about changes: Enabled
    • Email address authentication: Enabled
    • Database config
    • Database type: MySQL
    • Database host: localhost
    • Database name: wiki___{new_version} Ex: wiki81
    • DB username: <same>
    • DB password: <same>
    • Supervisor account: None
    • Database table prefix: {blank}
    • Storage engine: InnoDB
    • Database Char Set: MySQL 4.1/5.0 binary (efficient)
  4. Click [Install MediaWiki].
    The install finishes and gives you a page that echoes your settings. The /config directory now has a LocalSettings.php file created by the install.
  5. Copy \config\LocalSettings.php to parent dir:
    • cp config/LocalSettings.php .
  6. Test access to the wiki at http://test.platformatyourservice.com/lj___{new_version}/index.php
    (Undefined variables look like undefined templates, but the page can be reached.)
  7. Nuke the config/ dir:
    • rm -rf config/

Customize the Configuration

  1. In FileZilla, download LocalSettings.php
  2. Merge saved LocalSettings1.php into LocalSettings.php
    • Verify:
    • $wgScriptPath = "/lj___{new_version}";
    • $wgDBname = "wiki___{new_version}";
    • Change:
    • Use the "secret key" from the newly generated file (internal DB access)
    • $articlePath = "${wgScriptPath}/$1";
    • $wgEnableUploads = true;
    • Comment out Google analytics in the LongJump section, so they're disabled.
  3. Rename:
    • LocalSettings.php => LocalSettings_default.php
    • LocalSettings1.php => LocalSettings.php
  4. In FileZilla, upload LocalSettings.php

On the server:

  1. Log in as root
  2. Edit /etc/httpd/conf.d/mediawiki.conf:
    a. Copy the <Directory> section for the current version of the wiki
    b. Modify the path to point to the new wiki folder:
    <Directory /usr/share/mediawiki/lj___{new_version}>
    c. Add an Alias statement that points to that folder
    Alias /usr/share/mediawiki/lj___{new_version}
  3. Load the new configuration file:
    service httpd reload

Test the Sandbox

  1. Browse to the new wiki and check that the following operations work as expected:
    • Viewing pages
    • Editing pages
    • Uploading a file
  2. Once verified that it's working, tell Matt/Uday to:

Modify Wiki Content

  1. Change redirect-pages:
  2. Change these locations, if they are changed in the server build:
  3. Remove the pre-release versions of these pages from the prior version of the wiki, if they exist:
    • Release Notes
    • Doc Notes
    • ISV Release Notes pages

Clean up and Housekeeping

  1. Log in to the server as root
  2. From the command line, in the maintenance directory:
    • Remove old, deleted images that are taking up space in the archive:
    • php deleteArchivedFiles.php --delete
    • Remove versioned copies of images that are taking up space in the archive (Along with other revisions. C'est la vie.).
    • php deleteArchivedRevisions.php --delete
  3. Visit phpMyAdmin
  4. Select the new database
  5. Select the oldimage table
  6. Empty the table to clear the image history