Search

I have a site running on 1.7 and I am interested in importing my entries into 2.x. I read a few forum posts a while back saying there is no way (currently) to upgrade from 1.7.

I was wondering, will there ever be support to upgrade from 1.7?

I really don’t want to lose my entries and I’d like to upgrade to 2.

AFAIK, the only real way to upgrade and keep content is to manually recreate everything. I had talked to alistair about creating an XML export in 1.7 and an importer in 2, but I never got around to it. So, that’s possible, just not done.

If you’re handy with PHP, you could try this approach, but instead of pulling from Twitter, you pull from your old 1.7 site.

My guess is to create an XML page in your old 1.7 site for each section. Output all the fields for each entry.

Next, recreate those sections in your new 2.0 site and use a customized version of the PHP script above to grab and post the info from the pages you created in 1.7. (You won’t have to worry about error checking with cached entries since you’ll only import once.)

You will have to do it one section at a time, but you should be able to get all of your data imported. You’ll have to recreate all pages, data sources and adjust XSLT in the new install, but the data entry will be done.

Next, recreate those sections in your new 2.0 site and use a customized version of the PHP script above to grab and post the info from the pages you created in 1.7. (You won’t have to worry about error checking with cached entries since you’ll only import once.)

There is no need for a PHP file. You could just create use a front-end form that is populated with the data of your 1.7 XML file:

  1. Create your website using Symphony 2.
  2. Create an XML file containing all your Symphony 1.7 entries.
  3. Add this XML file to an external data source in Symphony 2.
  4. Create an event in Symphony 2, that allow multiple entry creation.
  5. Create a page called import and attach both, your data source and your event.
  6. Create a front-end form for your event (see the event documentation) that is dynamically populated with your XML data.
  7. Load your front-end form in your browser and submit it.
  8. All your entries should be imported in your new Symphony 2 site.
  9. Repeat these steps for all the sections you want to transfer.

Nils, how is this technique supposed to work with multiple entries? The form is filled with one entry only, isn’t it?

The form is filled with one entry only, isn’t it?

No, it isn’t if you use your import XML to build the form itself. Assuming your import XML looks something like this:

<data>
    <import>
        <entry>
            <title handle="handle-here">Title here</title>
            <text>Text here</text>
        </entry>
        <entry>
            <title handle="handle-here">Title here</title>
            <text>Text here</text>
        </entry>
        <entry>
            <title handle="handle-here">Title here</title>
            <text>Text here</text>
        </entry>
    </import>
</data>

you could create a front-end form like this (supposed you have an event called import with allow multiple):

<form method="post" action="" enctype="multipart/form-data">
    <input name="MAX_FILE_SIZE" type="hidden" value="5242880" />

    <xsl:for-each select="/data/import/entry">
        <label>Titel
            <input name="fields[{position()+1}][title]" type="text" value="{title}" />
        </label>
        <label>Text
            <textarea name="fields[{position()+1}][text]" rows="25" cols="50">
                <xsl:value-of select="text" />
            </textarea>
        </label>
    </xsl:for-each>

    <input name="action[import]" type="submit" value="Submit" />
</form>

Thank you, Nils!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details