2. Roadmap
1. Vanilla Migration - Step by Step
2. Making Deployment Easier - Tools and
Methods
3. Alternative Deployment
Methods
3. The Two Faces of EE
The Database The Files
- Could be locally hosted, already on
the server, or on another server.
- Contains most data that is fed into
ExpressionEngine.
- Locally hosted or on another server.
- Contains ExpressionEngine plus any
addons and their themes.
- Contains templates (if you are saving
templates as files).
- Contains hard-coded EE config files.
5. Your Setup
Staging Server? No staging server?
One developer or a team of developers?
What your setup is depends on your organizational needs, your
client's needs, and what is overkill.
6. Beforehand
Have an EE migration checklist handy.
Make sure the new server can handle ExpressionEngine.
Make sure you have enough time (no meetings in 15 minutes).
Make sure you have a backup plan if it hits the fan.
9. Step 2: Sync Templates
This is very easy to do on EE2.1
10. EE Templates
Is the template saved
as a file?
Yes
Notes
Get all data for the template out
of the database.
11. Step 2: Sync Templates
No native tool in EE1.x
Alternatives: Manual, third-party solutions.
DC Template Manager (Free)
"Saves the content of the template files (saved in the file-system) back to
the database."
http://devot-ee.com/add-ons/dc-template-manager/
12. Step 3: Export DB
Take note of Database collation. Changing the DB collation might break your
site entirely.
13. Database Collations
Notes
"Set of rules for comparing characters in a character set".
Defines the relationship of the character encoding to the actual
characters.
Default is latin1_swedish_ci, because the developers of MySQL
are Swedish.
Collations are needed for MySQL to perform logic - such as
ordering rows by strings in columns in different languages.
ExpressionEngine will, by default, create databases with utf8
character sets and utf8_general_ci collations.
14. Step 4: Create a New Database
Only necessary if moving databases.
Import SQL file and verify that collation is the same.
15. Step 5: Migrate File System
Don't delete existing data on the server.
Use an archive (tar or zip) if your host allows it.
& Set Permissions
Confirm and set file permissions as necessary.
16. File Permissions
/system/expressionengine/config/config.php
/system/expressionengine/config/database.php
666 (or equivalent)
/system/expressionengine/cache/
/images/avatars/uploads/
/images/captchas/
/images/member_photos/
/images/pm_attachments/
/images/signature_attachments/
/images/uploads/
777 (or equivalent)
Set applicable permissions for your template directory.
Check to see if add-ons have file permission needs.
Don't forget ALL the file's need correct permissions.
18. Step 6: Update Hardcoded Configs
Update configs in the file system for the database and basic
configs.
/system/expressionengine/config/database.php
/system/expressionengine/config/config.php
You can update the config.php values
in the Admin > System Administration
> Config Editor in EE2.
/system/config.php
/path.php
19. Step 7: Change Path Variables
EE likes to keep the server path in different places. You'll need to update
those.
Find your server path using the Tools > Utilities > PHP Info tool.
Your server path should be the _SERVER['DOMAIN_PATH']
variable.
20. Step 8: Update Additional Paths
Look for paths in JS, CSS, add-on paths, etc.
Remember hard-coded paths in templates. You can batch-remove these
with search and replace in EE2.
21. Step 9: Verify You Can Sync Templates
Use the EE2 Sync tool to make sure that you can synchronize your EE2
templates.
All your template data in the database should be up to date at this point in
the move, and you can re-create the directory if there are read/write issues.
22. Step 10: Clear Your Cache
Just do it. For fun.
Step 11: Verify Your .htaccess
.htaccess files tend to get lost in moves. You may need to re-create it or
modify it for a different server setup.
23. Step 11: Load Your Site
It either works or it doesn't or something in-between.
24. Contingency Plans
Put up old site and start steps from #1.
If you can access the CP, turn off the site and start searching on the
forums.
Check file permissions for files in general.
Turn on debugging index.php for PHP errors (EE2) or set error_reporting to
'E_ALL' in index.php (EE1)
26. DC Template Manager
"...DC Template Manager offers a
convenient way of moving the
contents of many templates between
the database and the filesystem
simultaneously."
Free
http://devot-ee.com/add-ons/dc-template-manager/
27. Deeploy Helper
"...collects many of the configuration
parameters we most frequently
modify on one page, where power
users can modify them all at once
with search and replace."
$9
http://devot-ee.com/add-ons/deeploy-helper/
28. Reelocate
"ExpressionEngine stores your website URL and
Server Path in a ridiculous number of places.
REElocate helps you update these in one simple
step."
Free
http://devot-ee.com/add-ons/reelocate/
29. EE Deployment Accessory
List (with links where applicable) and helpful resources.
Available at on the GEM blog www.greeneggmedia.com/blog
30. Sparrow
"Sparrow is the ultimate deployment tool. Its premise is simple:
make deployment insanely easy. It's powerful, flexible, and brilliantly
clever. It tracks your site's changes and pushes them out to servers.
It works perfectly with version control systems. It's the best solution
to this problem. Want to find out more? Visit http://getsparkplugs.
com/sparrow/ to register your interest."
- Jamie Rumbelow
32. Erskine Design's Modified EE
Setup
Talk from EECI2010 on modifying
ExpressionEngine 1 for efficiency.
config.php loads different config file based
on server IP.
Takes advantage of EE's hard-coded
configuration option.
Code available at:
http://eeinsider.com/blog/eeci-2010-how-erskine-
rolls-with-ee/
33. EE Config Handling
Notes
system/core.prefs.php handles preferences.
Preferences stored in database in serialized arrays.
Core Prefs saves config.php data, reads the preferences out of the
database, and then overwrites those with config.php items if available.
Config.php's $conf array can be populated with any viable config and it will
override the database version. Config.php can also be extended over
several files provided the $conf array is present, which is what Erskine is
doing.
34. Configs are in expressionengine/config/config.php in a $config array.
Preferences stored in database using base64 encoding.
EE_Config saves config.php data, reads the preferences out of the
database, and then overwrites those with config.php items if available.
Config.php's $config array can be populated with any viable config and it
will override the database version. Config.php can also be extended in the
same way as EE1.
EE Config Handling
Notes
36. Partial Deployment
Not every deployment includes the entire site.
Example: Making updates on a local environment and updating those on
the live site.
Methods include live development on hidden pages, manual uploading, and
versioning.
37. Using Git with EE
Git is a versioning system that keeps track of changes to files.
Git can be used to collaboratively work on EE sites (mainly using template
and theme files).
Can be set up to ignore EE files you never alter.
If you have SSH access to your server, you can deploy with Git commands
or automatically with Capistrano or with a paid solution like Beanstalk
Caveat: does not track database changes. (Channels, entries, etc.)
38. Ryan Masuga gave a fantastic talk
at EECI2010 EuroWorld which can
be found at:
http://gititon.masugadesign.com/
"Goal is to not edit anything in the
CP, ever"
The elephant in the room is the
database. No clear solution at this
point.
39. Resources, links, and more stuff can be found at:
http://www.greeneggmedia.com/deployment