A ruby script to aid migrating legacy content from old URLs.
Note: To use the migration script you will need to install Nokogiri
and OptionParser
by running sudo gem install nokogiri OptionParser
Note: To use the --new-url
/ -n
flag you first need to need install launchy
by running sudo gem install launchy
--help
alias[-h
]: Provides available options and usages on the command line--content-html-script
alias[-o
]: Adds script to paste HTML inside content editor (default: false)--copy-to-clipboard
alias[-c
]: Copies console script to clipboard (default: true)--original-url
alias[-u
]: Original url to migrate without user input (default: user input)--new-url
alias[-n
]: New url to open editing admin page (default: nothing)--base64-img
alias[-b
]: Encode <img> tags as base64 data (default: false)--update
alias[-e
]: Updates migration script (default: false)--parse-local
alias[-p
]: Parses from the local html file parse-option.html (default: false)
<h2>
header directly under<h1>
should be regular text size- No inline styles (colors, font-size, text-align, etc)
- Phone numbers should be formatted bold with tel link (
<strong><a href="tel:">
) - Any
<h2>
or<h1>
should be migrated as<h3>
- Remove (Updated 101316) or (Rev. 101316) from content
- Inline small images should be floated right
- Bullet lists should have a padding-left of
40px
- Make sure the content editor template matches the template on the google sheet
- On the google sheet mark the item you'll be working on with your name, and In Progress status.
- Open the Old URL you'll be migrating.
- Open Terminal and change to the directory with manually-migrate.rb (
cd /path/to/folder/dh_migration
) - Run
ruby manually-migrate.rb
and paste the Old URL into the input field. - Open the Content Editor and locate the shell page for the content you are migrating.
- Open the Developer Tools console and paste the Console Script generated by manually-migrate.rb
- Double check that the fields PageHeadTitle, PageHeadDescription and Content Title (Title, or Header) are filled .
- Double check that the checkboxes PageAddToSitemap and PageShowInSearch are checked.
- Open the Preview mode for the page you are working on.
- Edit the rich text editor and paste the Content HTML generated by manually-migrate.rb
- Insert / Upload any inline legacy images downloaded by the script.
- Add any missing line breaks (shift + enter)
- Pick a header image for your content.
- Hit Publish and go back to the google sheet to mark it Complete