This is a how-I-did-it and FYI post. I am not a frequent NG visitor, so my replies my be delayed. I would also like to note I would not be able to do this without the nukedgallery and its extraordinary knowledge base forum.
So before you begin, please do a favor to the NG operator and visit one or more of the sponsor ads or Goooogle ads, to which each visit helps defray the cost of running the NG website.
I have a 7.6x PHPNUKE website with about 4,000 members and about 12,000 Gallery1 pictures. Members have uploaded their own pictures. Retaining ownership of pictures is important.
If you have a phpnuke website and gallery1, and you want to migrate to gallery2:
0) read all steps before execution, to avoid any problems.
1) Follow the gallery1 to gallery 2 migration instructions here :
http://codex.gallery2.org/Gallery2:migr ... ntegration
-ignore import users step.
-import a couple, several, or all gallery1 albums - it doesn't matter, you want to make sure this step works, you will delete and re-import again later. (You made a backup of your albums, right?)
2) Install the Gallery2 PHPNuke Integration Pack (nukedgallery.net). If you do not understand this process, you should spend more time learning or pay someone to do this for you. Configure and import users in phpnuke admin. Make sure everything works ok (except for picture owners) From the nuke embedded gallery2 admin, delete any gallery1 imported albums, and import them again.
3) manually patch the gallery1->gallery2 migration files with the code from this post (the first post only, ignore the followup posts unless you know what you are doing): http://www.snailsource.com/forum/viewtopic.php?t=3571
4) in the same file as step #3 above (Gallery1DataParser.class)
find:
Code: › $query = "SELECT username, user_id FROM phpbb_users WHERE user_active = 1";
replace with:
Code: ›
// change nuke table prefix if neccessary
// $query = "SELECT username, user_id FROM phpbb_users WHERE user_active = 1";
$query = "SELECT username, user_id FROM nuke_users ";
find:
Code: ›
$query = "SELECT username, user_email, user_level, user_gallery_perm FROM phpbb_users WHERE user_active = 1 AND user_id = $uid";
replace:
Code: ›
// $query = "SELECT username, user_email, user_level, user_gallery_perm FROM phpbb_users WHERE user_active = 1 AND user_id = $uid";
$query = "SELECT username, user_email, name FROM nuke_users WHERE user_id = $uid";
just below the above code, you need to make your code resemble this:
(you'll need to use your brain here, no find and replace supplied)
Code: › while ($result = $results->nextResult()) {
$user['email'] = $result[1];
$user['fullname'] = $result[2];
$user['username'] = $result[0];
/* if($result[2] == 1) {
$user['isAdmin'] = 1;
}
elseif($result[3] == 2) {
$user['isAdmin'] = 1;
}
else {
$user['isAdmin'] = 0;
} */
}
5) In Gallery2, delete your previously imported Galler1 albums. Remember, Gallery2 does not (is not supposed to) change your gallery1 albums.
6) Import / migrate all of your gallery1 albums into gallery2. Your imported pictures into gallery2 should now retain their gallery1/phpnuke owners.
Extra credit:
7) In my phpnuke site, I control the full name (nuke_users.name) which often is not the same as the username (nuke_users.username).
With the following mod, the full name (nuke_users.name) is mapped to the Gallery 2 fullname:
in .\modules\<gallery>\admin\export.php:
find:
Code: › $sql = "SELECT user_id, username, user_password, user_email, user_lang, user_regdate FROM ". $prefix . "_users WHERE user_id = $cur_id LIMIT 1";
replace with:
Code: ›
// $sql = "SELECT user_id, username, user_password, user_email, user_lang, user_regdate FROM ". $prefix . "_users WHERE user_id = $cur_id LIMIT 1";
$sql = "SELECT user_id, username, user_password, user_email, user_lang, user_regdate, name FROM ". $prefix . "_users WHERE user_id = $cur_id LIMIT 1";
find:
Code: › $args = array('fullname'=> $row['username'], 'username'=> $row['username'], 'hashedpassword'=> $row['user_password'], 'hashmethod'=> 'md5' , 'email'=> $row['user_email'] , 'creationtimestamp'=> strtotime($row['user_regdate']));
replace with:
Code: ›
// $args = array('fullname'=> $row['username'], 'username'=> $row['username'], 'hashedpassword'=> $row['user_password'], 'hashmethod'=> 'md5' , 'email'=> $row['user_email'] , 'creationtimestamp'=> strtotime($row['user_regdate']));
$args = array('fullname'=> $row['name'], 'username'=> $row['username'], 'hashedpassword'=> $row['user_password'], 'hashmethod'=> 'md5' , 'email'=> $row['user_email'] , 'creationtimestamp'=> strtotime($row['user_regdate']));
delete all gallery1 imported albums.
import all gallery1 albums into gallery2.
Re-import gallery users in phpnuke admin, all users should be updated.
Please do not PM me for assistance, there are plenty of NG users and admins on this forum that are way smarter than I am, and I will leave it up to you and them to post corrections / additional information.
comments are welcome, please reply. If I am repeating a previous (and better stated post) then please delete this one. No need to confuse any more people than necessary.
best regards