Would someone from Top Notch be able to provide a general road map to migrate a site from Fusion 7.x-1.x/Skinr to 7.x-2.x/Accelerator?

Comments

sheena_d’s picture

Title: Migrating from Fusion/Skinr to Fusion/Accelerator » Create documentation for migrating from Fusion/Skinr to Fusion/Accelerator
Component: Miscellaneous » Documentation
Assigned: Unassigned » esmerel
Category: support » task
Status: Active » Needs work

We are currently working on documentation for making the switch from Skinr to Fusion Accelerator, We'll post an update here once it's ready.

The only changes that would need to be made to a sub-theme between 7.x-1.x and 7.x-2.x have to do with Skin definitions. Basically, the syntax for creating a Skin is the same as in Skinr 7.x-2.x, but you just replace every instance of "skinr" with "fusion_apply"

For example, in Fusion 7.x-1.x a skin was defined like this:

function fusion_core_skinr_skin_core_info() { 
  
  $skins = array();
   
  $skins['fusion_skins_block_positioning'] = array(
    'title' => t('Block position'),
    'type' => 'select',
    'description' => t('Change the position of this block (default is to float to the left)'),
    'group' => 'layout',
    'theme hooks' => array('block'),
    'default status' => TRUE,
    'options' => array(
      'fusion-right' => array(
        'title' => 'Float block to the right',
        'class' => array('fusion-right'),
      ),
      'fusion-center' => array(
        'title' => 'Position block in the center',
        'class' => array('fusion-center'),
      ),
      'fusion-clear' => array(
        'title' => 'Clear floats (block drops to a new line)',
        'class' => array('fusion-clear'),
      ),      
    ),
  );   
  return $skins;
}

and in Fusion 7.x-2.x, the syntax is thus:

function fusion_core_fusion_apply_skin_core_info() {

  $skins = array();
  
  $skins['fusion_skins_block_positioning'] = array(
    'title' => t('Block position'),
    'type' => 'select',
    'description' => t('Change the position of this block (default is to float to the left)'),
    'group' => 'layout',
    'theme hooks' => array('block'),
    'default status' => TRUE,
    'options' => array(
      'fusion-right' => array(
        'title' => 'Float block to the right',
        'class' => array('fusion-right'),
      ),
      'fusion-center' => array(
        'title' => 'Position block in the center',
        'class' => array('fusion-center'),
      ),
      'fusion-clear' => array(
        'title' => 'Clear floats (block drops to a new line)',
        'class' => array('fusion-clear'),
      ),      
    ),
  );

  return $skins;
}

Almost exactly the same, just the function name has changed.

Also, in the theme's .info file, for Fusion 7.x-1.x there are the following lines of code:

skinr[api] = 2
skinr[directory] = skins

and they need to be changed to:

fusion[api] = 2
fusion[directory] = skins

Let us know if you run into any snags, it will help us write better documentation.

Thanks,
Sheena

esmerel’s picture

Currently dependent on #1313768: 500 error after git clone and enable - Hoping to get in with aquariumtap this weekend at BADCamp and see if we can straighten out the problem there.

mshepherd’s picture

So @sheena_d - it's essentially swapping some function names from skinr to fusion(_apply)? I guess little has changed in the theme templates?

I'm going to have a try at this now. I'll post back any probs / findings.

mshepherd’s picture

Here's the process I used:

  • Make a note of any important block skins (For example, I have a few classes that are set from within the skin edit pages.)
  • Set default theme to Bartik
  • Disable and Uninstall Skinr module
  • Backup current skinr module and fusion 1.0 theme - just in case. Then delete both from the filesystem. I wasn't sure which version of fusion_core would be used in my base theme if I had both 1.x and 2.x on the filesystem?
  • Made the changes above in my theme.info file. I've not yet defined any skins, so I didn't need to change those.
  • Enable the Fusion Apply and Fusion Apply UI modules.
  • Flush caches to refresh the theme list
  • I didn't change my subtheme version from 7.x-1.0-alpha2 as this is simply added by the packaging script.
  • Set the default theme back to my Fusion subtheme.

And the result? Aside from having forgotten the few classed I'd set from within skinr, the site seems to be 99% OK. I'll get those classes added in again and hopefully all will be back to normal.

mshepherd’s picture

I've now added the various classes back into my skins (using the Edit Skin context link) and we're fully back in action. I guess it took around 15 minutes in total.

sheena_d’s picture

mshepherd,

Thanks for reviewing the upgrade process, that's really helpful!

Yes, there is pretty much no change from Fusion 7.x-1.0 to 7.x-2.0 except for the namespace change with Skin definitions. 2.0 is just sort of a stopgap to account for not using Skinr anymore. Lots of new functionality will be going into the Fusion Accelerator module in the future and if/when we do substantial updates to Fusion Core, we will issue a 3.0 version.

Thanks again!
Sheena

mshepherd’s picture

Thanks Sheena and you're welcome.
I can't wait to see where F&FA go! Always available for testing :)

esmerel’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

arski’s picture

Status: Closed (fixed) » Needs work

You might want to add that one should export the data from the skinr_rules and skinr_skins tables before uninstalling skinr and then import the data again into the fusion_apply_rules and fusion_apply_skinr tables.

"Make a note of any important block skins" - is simply not serious/professional.

sheena_d’s picture

Status: Needs work » Closed (fixed)

arski,

Our documentation cannot assume that the Skinr and Fusion Apply database schemas are exactly the same and will remain exactly the same forever. The only way to 100% ensure that Skinr skin settings will be duplicated in Fusion Apply skin settings is to manually migrate those settings.

arski’s picture

that's just lovely for people who have hundreds of Skinr settings.

Besides, at the moment the schemas are still the same, so you could at least write that "for people using skinr up to version x.x, you can copy paste the database tables to keep your settings" - don't see any harm in that.

sheena_d’s picture

Putting those directions into our documentation would necessitate that we support that approach to migrating Skin settings. While it's a perfectly easy and acceptable approach for users who are familiar with manipulating databases, most of our users do not have those advanced skills and would require a great deal of resources to support if/when they have problems migrating pieces of a database. Users who do have the more advanced skills necessary to easily execute this approach will come to the solution on their own.

arski’s picture

sure, but isn't the point of providing proper hook_update's on schema changes exactly that - so that the less advanced users would be able to upgrade the modules without having to manually mess around with the db. I agree that you'll probably experience quite a few support requests, but then provide at least a temporary update path with limited time support..

Anyway, I've migrated my stuff already, just finding this extremely annoying that such a huge switch needs to be done manually and that the old version is marked as "not supported" (which caused my client wanting to upgrade in the first place from a working skinr-based system.. duh)

cedewey’s picture

If anyone can provide more specific directions on how to migrate the Skinr data to Fusion Apply I would be eternally grateful (and would be willing to write up some documentation for others going through the same thing). I tried both exporting the Skinr configuration and then importing it into Fusion Apply through the UI, as well as simply copying the skinr_rules and skinr_skins tables over to the fusion_apply tables, but neither worked.

I have a feeling there's some syntax issues I need to clear up with these files, but I'm pretty new to all of this so any guidance would be great. Again, I would love to contribute back with some documentation once I get this going.

cedewey’s picture

Title: Create documentation for migrating from Fusion/Skinr to Fusion/Accelerator » Updated documentation for migrating from Fusion/Skinr to Fusion/Accelerator

OK, I figured it out and here is the documentation (as promised) I used to make it happen.

Upgrading Fusion 7.x-1.x themes to Fusion 7.x-2.x

If you have already started using Fusion 1.x for Drupal 7, and want to update your themes to Fusion 2.x, the process is fairly straight forward. The major change is the conversion from 1.x use of Skinr to Fusion Accelerator. If you have already begun using skins with Skinr, you should not see anything surprising in the changes here. This is a basic step-through of the changes you’ll need to make.

1. Set default theme to Bartik
2. Backup current Fusion 1.x theme if you're using a subtheme.
3. Follow normal update procedures for Fusion (deleted the old, place the new).
4. Install and enable Fusion Apply (and Fusion Apply UI)
5. Migrate skins from Skinr to Fusion Apply
5a. Copy data from skinr_rules table to fusion_apply_rules table

INSERT INTO fusion_apply_rules SELECT * FROM skinr_rules;

5b. Copy data from skinr_skins table to fusion_apply_skins table

INSERT INTO fusion_apply_skins SELECT * FROM skinr_skins;

6. Update function names associated with your skins
These functions will be located in any .inc files you created for your sub-theme (ideally located in sites/all/themes/your-sub-theme/skins

The only thing you need to change would be the function name, everything else is good to go.

So, for example you would only change the first line of the code below- function fusion_core_skinr_skin_core_info()

to- function fusion_core_fusion_apply_skin_core_info()

function fusion_core_skinr_skin_core_info() { 
  
  $skins = array();
   
  $skins['fusion_skins_block_positioning'] = array(
    'title' => t('Block position'),
    'type' => 'select',
    'description' => t('Change the position of this block (default is to float to the left)'),
    'group' => 'layout',
    'theme hooks' => array('block'),
    'default status' => TRUE,
    'options' => array(
      'fusion-right' => array(
        'title' => 'Float block to the right',
        'class' => array('fusion-right'),
      ),
      'fusion-center' => array(
        'title' => 'Position block in the center',
        'class' => array('fusion-center'),
      ),
      'fusion-clear' => array(
        'title' => 'Clear floats (block drops to a new line)',
        'class' => array('fusion-clear'),
      ),      
    ),
  );   
  return $skins;
}

Your new code would then be

function fusion_core_fusion_apply_skin_core_info() {

  $skins = array();
  
  $skins['fusion_skins_block_positioning'] = array(
    'title' => t('Block position'),
    'type' => 'select',
    'description' => t('Change the position of this block (default is to float to the left)'),
    'group' => 'layout',
    'theme hooks' => array('block'),
    'default status' => TRUE,
    'options' => array(
      'fusion-right' => array(
        'title' => 'Float block to the right',
        'class' => array('fusion-right'),
      ),
      'fusion-center' => array(
        'title' => 'Position block in the center',
        'class' => array('fusion-center'),
      ),
      'fusion-clear' => array(
        'title' => 'Clear floats (block drops to a new line)',
        'class' => array('fusion-clear'),
      ),      
    ),
  );

  return $skins;
}

Make sure you've done this for all functions in your .inc file(s).

7. Update your theme's .info file
In your .info file, changed the following code:

skinr[api] = 2
skinr[directory] = skins

update that to:

fusion[api] = 2
fusion[directory] = skins


8. Flush caches to refresh the theme list.
9. Set the default theme back to your Fusion (sub)theme.
10. If everything looks good, go ahead and disable, uninstall, and remove the Skinr module.

Congratulations! You are now leveraging the power of Fusion 2.x and Fusion Apply. oh yeah.

cedewey’s picture

Title: Updated documentation for migrating from Fusion/Skinr to Fusion/Accelerator » Create documentation for migrating from Fusion/Skinr to Fusion/Accelerator

Oops! Didn't mean to change the issue name.