ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Details on my successful migration of EE 1 Galleries to EE 2

November 09, 2012 8:55am

Subscribe [1]
  • #1 / Nov 09, 2012 8:55am

    Linda A

    666 posts

    In case there’s anyone else left out there who is stuck on EE 1 because of Galleries, you may find some useful information in my brief recap of how I migrated my galleries to EE 2.

    The key tool is the Importer from Solspace. I have also seen mentions of the DataGrab add-on, and it sounds like it would also work, but I haven’t used it myself.

    1) You will need to be able to run a copy of your database/website somewhere. I left my live site on EE 1 and setup a second database and corresponding web folders to run the EE 2 upgrade on.

    2) Once you have run the EE 2 upgrade on the secondary site, I would suggest setting up the channels that will now hold your Gallery data (this method supposes Galleries where one gallery entry = one channel entry), the Categories for those channels and their Field Groups (don’t forget a custom field of type File to actually hold your image data) and also the Upload Destinations. If you can just map the Upload Destinations to where your images are already stored on your server, that is probably easiest. Then you just need to run a Synchronize to get the images recognized.

    3) You will need to export your gallery data. I choose to do this by creating an Export template for each Gallery. Here’s an example of one of those templates:

    {exp:gallery:entries gallery="gallery7" orderby="entry_date" limit="1000" rows="1"}
    {entries}
    {row}|{title}|,|{entry_date format="%U"}|,|{image_url}|,|{caption}|,|{custom_field_one}|,|{category}|,|{exp:query sql="SELECT * FROM exp_tag_entries AS te JOIN exp_tag_tags AS tt ON tt.tag_id = te.tag_id WHERE te.entry_id = {entry_id} AND te.type = 'gallery'"}{tag_name},{/exp:query}|{/row}
    {/entries}
    {/exp:gallery:entries}

    What data you need to export depends on your Gallery setup, of course. We did find after much trial and error that | as the delimiter seemed to work best and was least likely to conflict with the captions, for example.

    If you are keeping your images in the same directories as before, the easiest way to get a correct value for the File custom field in your new Channel (the File custom field is the one that will hold your image location) is to edit out the first part of the url so that you are left with just the filename and then insert {filedir_X} before the filename, where X is the ID of that Upload Destination.

    The Export phase was the trickiest for us, because getting the csv file just right took a lot of fiddling.

    4) Install Solspace’s Importer on the secondary site that you have upgraded to EE 2. Create an import profile for one of the new Channels and grab the appropriate Export file. The Importer documentation should be pretty straight-forward at this stage.

    If anyone wants to give this a try and has any questions, let me know. This explanation could definitely be improved on, so if I get some feedback on what is missing I will try to do that. 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases