Piwigo.org

You are not logged in. (Register / Login)

Announcement

#46 2014-12-02 22:30:18

como
Member
Registered: 2014-11-22
Posts: 3

Re: FAQ? Migrating from gallery 2 to piwigo

plg wrote:

I have to check this, mainly if it doesn't break other things.

Here is my experience after second import from Menalto gallery 2:
- Confirm that using html_entity_decode is safe and helps import html tags in titles and descriptions!
- First attempted to use menalto2piwigo module from Github, but it was a disaster - many thumbnails in subalbums become same! Then returned to code from menalto2piwigo_2.7.b, and obtained errors reported in this topic (related to parent id). Then I made simple check for parent id:
    if ($parentId <> '') {
after line 162, closing 'if' statement where foreach cycle ends.

This resolved errors and import was successful!

Hope this can help improving module.

Offline

 

#47 2014-12-28 03:54:46

judecooks
Member
Registered: 2014-08-16
Posts: 1

Re: FAQ? Migrating from gallery 2 to piwigo

wsloand wrote:

I just tried the new version, and I'm getting a similar error:

Error, c273 is not an image and Menalto says it is an image


Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='IMG_2274.CR2'' at line 16

SELECT
    f.g_id,
    i.g_title,
    i.g_summary,
    i.g_description,
    i.g_canContainChildren,
    a.g_orderWeight,
    a.g_viewCount,
    FROM_UNIXTIME(e.g_creationTimestamp)
  FROM g2_Item i
    JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
    JOIN g2_ChildEntity c ON f.g_id = c.g_id
    JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
    JOIN g2_Entity e ON e.g_id = i.g_id
  WHERE c.g_parentId =
    AND f.g_pathComponent='IMG_2274.CR2'
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_row() on a non-object in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 216


Warning:  [mysql error 1146] Table 'gallery2.piwigo_sessions' doesn't exist

REPLACE INTO piwigo_sessions
  (id,data,expiration)
  VALUES('[removed]','pwg_uid|i:1;pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;need_update|b:0;extensions_need_update|a:0:{}',now())
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830

Getting the same error on my import as well:

Error, c259 is not an image and Menalto says it is an image


Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='1year'' at line 16

SELECT
    f.g_id,
    i.g_title,
    i.g_summary,
    i.g_description,
    i.g_canContainChildren,
    a.g_orderWeight,
    a.g_viewCount,
    FROM_UNIXTIME(e.g_creationTimestamp)
  FROM g2_Item i
    JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
    JOIN g2_ChildEntity c ON f.g_id = c.g_id
    JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
    JOIN g2_Entity e ON e.g_id = i.g_id
  WHERE c.g_parentId =
    AND f.g_pathComponent='1year'
; in /home/username/website/piwigo/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_row() on a non-object in /home/username/website/piwigo/include/dblayer/functions_mysqli.inc.php on line 216

Offline

 

#48 2015-01-06 13:19:25

jc
Member
Registered: 2015-01-04
Posts: 20

Re: FAQ? Migrating from gallery 2 to piwigo

My hints about migration from G2:

1. I had to disable Exif View module because theese errors:

~50x: Warning: Division by zero in /data/www/my_web/foto/plugins/exif_view/main.inc.php on line 258

Warning: Cannot modify header information - headers already sent by (output started at /data/www/my_web/foto/plugins/exif_view/main.inc.php:258) in /data/www/my_web/foto/include/page_header.php on line 101

2. For me must have setting: $conf['sync_chars_regex'] = '/^[a-zA-Z0-9-_.&, !]+$/';

Maybe better default?

3. Virtualize extension needs full permissions to /galleries/ too. What about checks on /admin.php?page=plugin-menalto2piwigo or some notes at least? (sorry for offtopic)

Generally it works very well. So thank you for your work, great photo gallery and all about that.

Offline

 

#49 2015-01-06 13:57:10

wsloand
Member
Registered: 2014-11-17
Posts: 31

Re: FAQ? Migrating from gallery 2 to piwigo

I second expanding $conf['sync_chars_regex'] (or making it unnecessary).  As I recall from the documentation, $conf['sync_chars_regex'] is there to help with unusual characters in file names.  But, I can imagine that it makes it harder to use in countries that use non-Latin character sets (e.g. large parts of southeast Asia).

I guess that it could be made unnecessary by changing it to something all-inclusive like:  $conf['sync_chars_regex'] = '.'

How would it break piwigo to allow any character in a filename?

Offline

 

#50 2015-01-06 14:07:19

jc
Member
Registered: 2015-01-04
Posts: 20

Re: FAQ? Migrating from gallery 2 to piwigo

Btw i am old-linux user. I am not using local characters in filenames, but there are still some -, _ etc.

Offline

 

#51 2015-01-07 03:50:32

peshko
Member
Registered: 2015-01-07
Posts: 1

Re: FAQ? Migrating from gallery 2 to piwigo

I just tried to run the migration. Here are the errors that I got. Any help would be appreciated:

Error, c4 is not an image and Menalto says it is an image

Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='IMG_0272.JPG'' at line 16

SELECT
    f.g_id,
    i.g_title,
    i.g_summary,
    i.g_description,
    i.g_canContainChildren,
    a.g_orderWeight,
    a.g_viewCount,
    FROM_UNIXTIME(e.g_creationTimestamp)
  FROM g2_Item i
    JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
    JOIN g2_ChildEntity c ON f.g_id = c.g_id
    JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
    JOIN g2_Entity e ON e.g_id = i.g_id
  WHERE c.g_parentId =
    AND f.g_pathComponent='IMG_0272.JPG'
; in /var/www/photos/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_row() on a non-object in /var/www/photos/include/dblayer/functions_mysqli.inc.php on line 216



Warning:  [mysql error 1146] Table 'gallery2.piwigo_sessions' doesn't exist

REPLACE INTO piwigo_sessions
  (id,data,expiration)
  VALUES('25bvo3jtf193tg9a21dsffm680','pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;pwg_uid|i:1;need_update|b:0;extensions_need_update|a:0:{}incompatible_plugins|a:1:{s:10:\"~~expire~~\";i:1420509453;}selected_category|a:1:{i:0;s:1:\"1\";}bulk_manager_filter|a:1:{s:9:\"prefilter\";s:6:\"caddie\";}',now())
; in /var/www/photos/include/dblayer/functions_mysqli.inc.php on line 830

Offline

 

#52 2015-01-09 15:29:29

windracer
Member
Location: St. Pete, FL
Registered: 2014-12-28
Posts: 152
Website

Re: FAQ? Migrating from gallery 2 to piwigo

I just wanted to say thank you for this great migration plugin!

I just completed moving my two large (14k and 16k items) Gallery 3 installations into a single Piwigo site and this plugin saved me a ton of work by migrating my names, descriptions, tags, etc. I still had some manual cleanup to do (merging duplicated tags from merging the two sites, updating URLs, etc.), but that's to be expected in any large migration/conversion project like this.

One thing I wanted to suggest: having the VideoJS plugin (or something else like it) installed allows the "synchronize" process to import movies (i.e., MP4 files) from G3 into PWG. However, the current version of the menalto2piwigo plugin ignores items with type 'movie' when it's copying across names, descriptions, comments, etc. I was able to correct this by including a "if ('movie' == $row['type'])" block in admin.php as a copy of the 'photo' one.

Offline

 

#53 2015-01-09 15:47:05

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13080
Website

Re: FAQ? Migrating from gallery 2 to piwigo

I just released a new version 2.7.c (I should have released it earlier but I wanted to finish [Github] menalto2piwigo issue #7 but I didn't so let's release).

windracer wrote:

I was able to correct this by including a "if ('movie' == $row['type'])" block in admin.php [...]

Did you only do that? Can you show the diff? (or fork + pull request on Github)


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#54 2015-01-09 15:48:19

plg
Piwigo Team
Location: Nantes, France, Europe
Registered: 2002-04-05
Posts: 13080
Website

Re: FAQ? Migrating from gallery 2 to piwigo

Hi wsloand,

wsloand wrote:

How would it break piwigo to allow any character in a filename?

It would break on some specific characters like ' (single quote, apostrophe) but for other characters, I admit I didn't see problems on my tests.


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#55 2015-01-09 21:25:48

windracer
Member
Location: St. Pete, FL
Registered: 2014-12-28
Posts: 152
Website

Re: FAQ? Migrating from gallery 2 to piwigo

plg wrote:

windracer wrote:

I was able to correct this by including a "if ('movie' == $row['type'])" block in admin.php [...]

Did you only do that? Can you show the diff? (or fork + pull request on Github)

Unfortunately I can't give you a nice diff since I did a real hatchet job on admin.php so I could re-run it only for my movies which were all missing their metadata from the initial load. I didn't want to risk more duplicate tags or messing up what the plugin had already done.

But yes, basically I just added this block, inserted in your if logic around line 444, to match what you do for photos, except for the movie items (I didn't bother with hits, ratings, etc. since I didn't use those in G3):

Code:

      elseif ('movie' == $row['type'])
      {
        $image_id = substr($piwigo_id, 1);
      
        $image_updates[] = array(
          'id' => $image_id,
          'name' => pwg_db_real_escape_string($row['title']),
          'comment' => pwg_db_real_escape_string($row['description']),
          'date_available' => date('Y-m-d H:i:s', $row['created']),
          );

        // build a map from menalto ids to piwigo image ids
        $iid[ $row['id'] ] = $image_id;
      }
    }

Offline

 

#56 2015-01-09 21:28:19

jc
Member
Registered: 2015-01-04
Posts: 20

Re: FAQ? Migrating from gallery 2 to piwigo

plg thx for updates. I have some questions about album sorting. In my old G2 i used Original date of album and all was sorted by this.

I read all of resolved - Manually editing database - trying to make album sort work properly. but still i don't know where the problem is. In my database all of categories have lastmodified time same like migration time (2015...).

So my questions:

1. Is lastmodified category column used for album view, sorting or something like that?

2. Sorting in global configuration menu is for photos only or albums too?

3. Is there a way to import original galleries dates and/or sorting album by this?

Thx.

Offline

 

#57 2015-02-09 15:00:48

jc
Member
Registered: 2015-01-04
Posts: 20

Re: FAQ? Migrating from gallery 2 to piwigo

And my answers:

1. Is lastmodified category column used for album view, sorting or something like that?

NO

2. Sorting in global configuration menu is for photos only or albums too?

FOR PHOTOS ONLY

3. Is there a way to import original galleries dates and/or sorting album by this?

HACK ONLY

About order imports from G2. G2 use  g2_ItemAttributesMap.g_orderWeight IF manual sort is used. This column is for photos and albums too.

Piwigo don't automatically sorts sub-albums (see BUG #3172), but it imports order of photos AND albums based on g_orderWeight, which is used ONLY for manual sorting.

So my hack to import my G2 order:

1. i wrote this PHP script which will touch (=change mtime and ctime) all directories/albums based on album date from G2 database

2. I rewrote PHP code in piwigo/admin/include/functions.php. With this code import from galleries dir respects directory mtime and imports albums based on this. Without that it is pretty random.

So after initial import of albums from dirs you have a good ordered albums.

3. I overwrite file piwigo/plugins/menalto2piwigo/admin.php and commented out every (four) lines with "rank". Piwigo use rank to order by. With this commented, you will have all other metadata from G2, but order stays like before.

A very simple patch.

P.S. some info and scripts download for czech speaking users which i working on

Offline

 

#58 2015-02-24 08:28:37

jc
Member
Registered: 2015-01-04
Posts: 20

Re: FAQ? Migrating from gallery 2 to piwigo

Another ugly code to list all albums and their permissions. Because menalto2piwigo plugin don't migrate users, groups and permissions, you have to set them manually.

Offline

 

#59 2015-03-04 02:55:56

paul witt
Guest

Re: FAQ? Migrating from gallery 2 to piwigo

Got these errors at the Import Step. Any assistance on what to do next is greatly appreciated. Am excited to try out Piwigo. Am long-time Gallery user. Hopeful my archives can be ported over.

Notice: Undefined variable: hid in /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php on line 350

Warning: Invalid argument supplied for foreach() in /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php on line 350

Notice: Undefined variable: image_updates in /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php on line 413

Notice: Undefined variable: cat_updates in /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php on line 422

Notice: Undefined variable: album_thumbs in /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php on line 431

Warning: Cannot modify header information - headers already sent by (output started at /home2/wittenbp/public_html/pimage/plugins/menalto2piwigo/admin.php:350) in /home2/wittenbp/public_html/pimage/include/page_header.php on line 101

 

#60 2015-03-04 06:24:27

paul witt
Guest

Re: FAQ? Migrating from gallery 2 to piwigo

I made the last post about the errors on import with Gallery 2 Piwig. That one was with a Gallery 2 install. I just tried to import another smaller Gallery 3 archive to another piwig install. Similar errors on that one. Any guidance is greatly appreciated.
HEre are the Gallery 3 errors:
Notice: Undefined variable: cover_id in /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php on line 578

Warning: Invalid argument supplied for foreach() in /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php on line 578

Notice: Undefined variable: image_updates in /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php on line 700

Notice: Undefined variable: cat_updates in /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php on line 709

Notice: Undefined variable: album_thumbs in /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php on line 718

Warning: Cannot modify header information - headers already sent by (output started at /home2/wittenbp/public_html/pspace/plugins/menalto2piwigo/admin.php:578) in /home2/wittenbp/public_html/pspace/include/page_header.php on line 101

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2017 · Contact