How to run the import process?
------------------------------
1. Download eZ publish 3.x.

2. Dump data from eZ publish 2.2 database. ( Suppose your database called publish,
                                             run for example "mysqldump -uuser -ppassword publish > dump.sql" );

3. Import dump data from 2.2 into your 3.x database. ( Suppose you have created database test, run "mysql -uuser -ppassword test < dump.sql" )

4. Move image and binary files from eZ publish 2.2 storage to eZ publish 3.x storage.

    4.1 Move eZpublish22root/ezimagecatalogue/catalogue directory to eZpublish3xroot/var/storage/

    4.2 Move eZpublish22root/ezfilemanager/files to eZpublish3xroot/var/storage/

5. Run "php -C importuser.php"

6. Run "php -C importfolder.php"

7. Run "php -C importimage.php"

8. Run "php -C importfile.php"

9. Run "php -C importarticle.php"

10. Run "php -C importarticle.php" again to fix link problems by regenerating contents of article.
    ( This is especially useful when an article has a link to another article which published later, running
      only once of the script will get dead link )

11. Run "php -C importarticlecomment.php" to add top level comments.

12. Run "php -C importarticlecomment.php" again to add children to top level comments.

13. Run "php -C translateURL.php" to add URL alias.

14. Post import operation. For example, create user section and assign it to users, assign roles to imported user groups.


Some notes about these import script:
----------------------------------------
1. To support import different 2.2 sites( databases ) into a single 3.x database, you need to give a distinguished name
   when running all above scripts. For example, run "php -C importuser.php database1", "php -C importfolder.php database1" and 
   so on. When you are going to import from a different database, run "php -C importuser.php database2", 
   "php -C importfolder.php database2" and so on. ( Of course, you need to re-import dump data first )

2. Only support user, image, file, article, article comment import. All images will be imported
    to image folder under root and all files will be imported to file folder under root. Imported articls will
    have the same structure as in 2.2 version. ( under same article category )

3. All unsupported tag will be converted to <custom name="$tagName">content</custom>.

4. Tag <html> will be converted to <literal class="html">content</literal>, by using template override, you
   will get desired result as before.

5. <image align="float" size="original"> will be converted to <object align="inline" size="reference">, we will support
   these in eZ publish further releases.

6. When you run importarticle.php, if it stopped and you got the following error message:
   --------------------------------------------------------------
   ...
   ...
   import article 138
   import article 139
   <br>
   <b>Fatal error</b>:  Call to a member function on a non-object in <b>/home/wy/projects/php/31stable/ez22to30xmlimport.php</b> on line <b>20</b><br>
  ---------------------------------------------------------------
   It means that article 139 may have illegal xml format. You should add line
   $badArticleIDList[] = 139;
   into function addArticle() in importarticle.php and re-run the script. Add a new line if you get this kind of error message again.
