complex joomla! migrations

Post on 12-Nov-2014

223 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Joomla version numbering explained, best Joomla migration practices, tips and how to handle complex Joomla Migrations.

TRANSCRIPT

JoomlaDay Deutschland 2014 Sander Potjer - @sanderpotjer - Joomla! Community Leadership Team

Complex Joomla! Migrations

Sander Potjer !

Involved in the local Dutch Joomla community

Joomla Community Leadership Team (CLT) member

Company: Perfect Web Team

ACL Manager developer

E-mail: sander.potjer@community.joomla.org

Sander Potjer !

Involved in the local Dutch Joomla community

Joomla Community Leadership Team (CLT) member

Company: Perfect Web Team

ACL Manager developer

E-mail: sander.potjer@community.joomla.org

Slides: www.sanderpotjer.nl

Complex Joomla Migrations

Joomla Version Number

3.3.3

3.3.3 [major].[minor].[maintenance]

3.3.3 [major].[minor].[maintenance]

(An increment of the major number generally indicates a major rework or rewrite of the code base)

3.3.3 [major].[minor].[maintenance]

(An increment of the minor number usually indicates a significant change in functionality.)

3.3.3 [major].[minor].[maintenance]

(An increment of the maintenance number usually indicates bug fixing within the minor release and possibly small enhancements and limited new features.)

2.5.2 vs 2.5.19

2.5.2 < 2.5.19

Joomla Version History

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0

1.0.15

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

1.0.15

1.5.26

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

1.0.15

1.5.26

1.6.6

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

3.1.6

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

3.1.6

3.2.3

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

3.1.6

3.2.3

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

3.1.6

3.2.3

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5 1.0

1.0.15

1.5.26

1.6.6

1.7.5

2.5.19

3.0.4

3.1.6

3.2.3

Simplify Things

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1

Joomla 2

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1

Joomla 2

Joomla 3

Supported Joomla Versions

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1 Unsupported: migrate

Joomla 2

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 2 Use latest version: 2.5.24

Joomla 3

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 3 Use latest version: 3.3.3

Migration. Upgrade. Update.

3.3.3 Migration.Upgrade.Update

3.3.3 [major].[minor].[maintenance]

3.0.0 [major].[minor].[maintenance]

(Can be incompatible with prior major releases.)

3.3.0 [major].[minor].[maintenance]

(Moderate to high level of backward compatibility with previous minor increments.)

3.3.3 [major].[minor].[maintenance]

(Fully backward compatible with previous maintenance increments.)

Upgrade Strategy

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

Joomla 1.0 1.0Joomla 1.5

Joomla 1.6

Joomla 1.7 1.0Joomla 2.5

Joomla 3.0 1.0Joomla 3.1 1.0Joomla 3.2 1.0Joomla 3.3 1.0Joomla 3.4

Joomla 3.5

Joomla 1 -> Joomla 2 or 3

Joomla 2 -> Joomla 3

Joomla versions are as simple as

Joomla versions are as simple asJoomla 1 = upgrade your site

Joomla versions are as simple asJoomla 1 = upgrade your site Joomla 2 = use latest version

Joomla versions are as simple asJoomla 1 = upgrade your site Joomla 2 = use latest version Joomla 3 = use latest version

Joomla 1 = upgrade your site

Migrations

Migration Questions

1 : 1 migration?

Frustrations?

Wishes?

Unused?

Extensions Available?

Better Alternatives?

3 Types of Migrations

Easy Type: static sites

Freeze: 1 week or more Downtime: not relevant

Preparations: none, replace when ready

Hard Type: dynamic sites Freeze: max. 1 week

Downtime: max. 1 hour Preparations: as much as possible

Complicated Type: very dynamic & high traffic sites

Freeze: max. 1 day Downtime: each minute costs money Preparations: very detailed & tested

Tips for any Joomla Migration

->

Choose Joomla 3

Test Backup!

Clean up

Empty Trash

Database Fix

Error Reporting Maximum

Same Environment

Test

Test

Test

Test

TestTest

Typical Migration Process

1. Backup

1. Backup 2. Create copy of website (www.site.com/15)

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3)

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3) 5. Install Joomla 3 version of extensions

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3) 5. Install Joomla 3 version of extensions 6. Adjust files, like templates & Joomla settings

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3) 5. Install Joomla 3 version of extensions 6. Adjust files, like templates & Joomla settings 7. Test result of migration

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3) 5. Install Joomla 3 version of extensions 6. Adjust files, like templates & Joomla settings 7. Test result of migration 8. Publish new website (.com -> .com/old & .com/3 -> .com)

Case:

Complex Migration Request

Case:

Complex Migration Request

Case:

Complex Migration Request - Migration within max 1,5 day freeze, max 2 hours downtime during evening hours - Identical layout, functionality, URLs, menus, articles, etc. - In short: the visitor should not see or experience differences between Joomla 1.5 and Joomla 2.5 version

1. Backup 2. Create copy of website (www.site.com/15)

3. Install new Joomla version (www.site.com/3)

4. Migrate website data (.com/15 -> .com/3) 5. Install Joomla 3 version of extensions 6. Adjust files, like templates & Joomla settings 7. Test result of migration 8. Publish new website (.com -> .com/old & .com/3 -> .com)

1500 articles 650 menu-items

950 modules 20+ extensions

Setting Change Example

Menu-Module !

!

Setting Change Example

Menu-Module !

vs level

Joomla 1.5 Joomla 2.50-3 1-4

Record Database Changes

Create Custom Script www.site.com/migrate.php

Change Modules with ID’s 223, 294 and 357

Change Modules with ID’s 223, 294 and 357

- “startLevel” of module with ID 233 is changed from 2 to 3. - “menutype” is added for module with ID 294

- “You are here” text is set to “hide” for the breadcrumbs module with ID 357.

www.site.com/migrate.php

define('_JEXEC', 1);!!

// Connect with Joomla!define('JPATH_BASE', __DIR__);!require_once JPATH_BASE . '/includes/defines.php';!require_once JPATH_BASE . '/includes/framework.php';!!

// Database connection!$db = JFactory::getDBO();

www.site.com/migrate.php /**! * Module changes! */! !// Get the modules that need changes!$query = $db->getQuery(true);!$query->select('*')!!->from('#__modules')!!->where('id IN (233,294,357)');!$db->setQuery($query);!$modules = $db->loadObjectList('id');!!

foreach($modules as $module)!{!!$module->params = json_decode($module->params);!}

www.site.com/migrate.php

// Change startLevel!if ($modules[233]->params->startLevel == 2)!{!!$modules[233]->params->startLevel = 3;!!echo('<strong>Module [233]:</strong> startLevel: 3 <br/>');!}

www.site.com/migrate.php

// Set menutype!if (empty($modules[294]->params->menutype))!{!!$modules[294]->params->menutype = 'mainmenu';!!echo('<strong>Module [294]:</strong> menutype: mainmenu <br/>');!}

www.site.com/migrate.php

// Hide breadcrumb "You are here"!if (!$modules[357]->params->showHere)!{!!$modules[357]->params->showHere = 0;!!echo('<strong>Module [357]:</strong> showHere: 0 <br/>');!}

www.site.com/migrate.php

// Save new module params!foreach($modules as $id=>$module) !{!!$params !!= json_encode($module->params);!!$mod !!!= new JObject();!!$mod->id !!= $id;!!$mod->params!= $params;!!!!$result = $db->updateObject('#__modules', $mod, 'id');!}

Correct component specific

Correct component specific - set Access to 1 for all items in ZOO

www.site.com/migrate.php /**! * Component changes! */! !// ZOO access fixes!$query !!= $db->getQuery(true);!$fields != array('access=1');!$conditions = array('access=0');!$query->update($db->quoteName('#__zoo_item'))->set($fields)->where($conditions);!$db->setQuery($query);!!

$result = $db->query();!echo('<strong>ZOO:</strong> Access set to 1 <br/>');

Custom Script Example https://gist.github.com/sanderpotjer/9311435

Clean Joomla 3 Base

Test

Adjust Custom Script

Test

Adjust Custom Script

Test

Adjust Custom Script

Migration Script (non code)

10:30 - 11:00 hour Migration day kickoff meeting

11:00 - 12:30 hour Exact.nl backup maken & compare: - Create Backup of Joomla 1.5 version - Install locally - Compare Backup with version used for preparations - Adjust Joomla 2.5 site if needed

11:00 - 12:30 hour Joomla 1.5 site preparations: - Empty categories trash - Empty articles trash - Empty menu trash - General Check-In

11:00 - 12:30 hour Joomla 2.5 site preparations: - Create new database with "clean" dataset (without exact.nl content data) - SP Upgrade configuration - Static server files sync between 1.5 site and 2.5 site - Publish Joomla 2.5 base version with static files on www.exact.nl/25/

Lunch

13:00 - 16:00 hour Test migrations - Test migraties according "Migration Manual" - After test, restore as "Joomla 2.5 site preparation" status !

Check result of test migrations [Client] - Test migration result and report issues

13:00 - 16:00 hour Roll-out fixes - In case of issues, improve migration script !

Prepare off-line page - Specific page visible during the migration downtime

16:00 - 17:30 hour Final opportunity for content changes on live site - No content changes after 16:00 hour - Administration area restricted - Visitors can still use the full functionality of the website, form submissions won’t get lost

16:00 - 17:30 hour Final test migration - Final test migraties according "Migration Manual" !

Final Joomla 2.5 site preparations: - Create new database with "clean" dataset - Static server files sync between 1.5 site and 2.5 site - Publish Joomla 2.5 base version with static files on

Pizza!

19:00 - 19:15 hour Final checks - Check if Joomla 1.5 site is ready - Check if Joomla 2.5 site is ready - Check database tables - Check if required software & connections are ready - Check if hosting provider is ready

19:15 - 19:30 hour Migrations www.exact.nl - Final migraties according "Migration Manual" - During this period www.exact.nl is offline, visitors can’t use the website

19:30 - ? : ? hour Monitoring of www.exact.nl - Monitoring of migrated website - Apply small bug-fixes if needed - In case of bigger issues a revert of the Joomla 1.5 site according the "Emergency Revert Manual" - Old Joomla 1.5 version available for reference on www.exact.nl/15/

Celebrate!

Celebrate!

Migration Manual

1) Set exact.nl (Joomla 1.5) site off-line (+/- 0,5 minute)

2) Back-up Joomla 1.5 site (+/- 5 minutes)

3) SP Upgrade migration (+/- 1 minute) Data migration via SP Upgrade extension - Users - Content - Newsfeed - Menus - Modules

4) Manual tables export, conversion & import (+/- 3 minutes) jos_advancedmodules jos_exactlog jos_exacttracking jos_exacttracking_pages jos_jdownloads_* jos_rseventspro_*

jos_rsfirewall_* (except config) jos_rsform_* jos_snippets jos_virtuemart_* (except config) jos_widgetkit_widget jos_zoo_*

5) Manual operations in 2.5 site (+/- 2 minutes) - Install Advanced Module Manager - Install RSEventsPro - Install RSFormPro - Install RSFirewall - Run VirtueMart Tools -> Update tables - Run SP Upgrade - Run custom Exact conversion script

5) Manual operations in 2.5 site (+/- 2 minutes) - Run Joomla Advanced Search (Finder) indexer - Fix Asset Issues with ACL Manager - Configure frontend/backend .htaccess files - Check memcache configuration - Publish obGrapper pipes - Clear cache

6) Check result (+/- 2 minutes) Check migration result on www.exact.nl/25/

7) Move Joomla 1.5 site (+/- 0,5 minute) Move www.exact.nl to www.exact.nl/15/

8) Move Joomla 2.5 site (+/- 0,5 minute) Move www.exact.nl/25/ to www.exact.nl/

9) Adjust configuration.php paths (+/- 0,5 minute) Adjust the /tmp/ and /log/ folder paths in www.exact.nl/configuration.php and www.exact.nl/15/configuration.php

10) Set exact.nl (Joomla 2.5) site on-line (+/- 0,5 minute)

Emergency Revert Manual

1) Set exact.nl (Joomla 2.5) site off-line (+/- 0,5 minute)

2) Move Joomla 2.5 site (+/- 0,5 minute) Move www.exact.nl to www.exact.nl/25/

3) Move Joomla 1.5 site (+/- 0,5 minute) Move www.exact.nl/15/ to www.exact.nl/

4) Adjust configuration.php paths (+/- 0,5 minute) Adjust the /tmp/ and /log/ folder paths in www.exact.nl/configuration.php and www.exact.nl/25/configuration.php

5) Set exact.nl (Joomla 1.5) site on-line (+/- 0,5 minute)

Case Results:

Complex Migration Request !

freeze & downtime: 6 minutes

Case Results:

Complex Migration Request !

freeze & downtime: 6 minutes preparation time: 2-3 weeks

Resources Article: “Complex Joomla! 1.5 Migration With Minimal Downtime” http://magazine.joomla.org/issues/issue-mar-2014/item/1794-complex-joomla-15-migration-with-minimal-downtime !

Custom Migration Script Example https://gist.github.com/sanderpotjer/9311435 !

Presentation slides http://sanderpotjer.nl

top related