modify G1 Migration according to UserAlbums Module

joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Thu, 2005-10-20 03:25

I would like to migrate albums of my users from g1 to g2.

I guess i need to do some modification to the migration module, to import everything from root/ into something_i_specify/<username>/ .

the question is how to do it with Confirmimport.inc? :)

i think after checking the code, that by modifing this part:

/*
* if the album's parent is not in the list of sourcealbums,
* load it into the targeted G2 top album as set in $destinationAlbumID
*/
$targetAlbumID = $newAlbumInstanceId = $isHiddenAlbum = false;
if (!in_array($album['parentAlbumName'], array_keys($form['sourceAlbums']))) {
$targetAlbumID = $destinationAlbumID;

with changing the last line to : $targetAlbumID = $album['owner'];
could do the trick..but..
1. what if that album is not exist? :o
then it should create that with the appropiate permissions..i guess the code could be taken from the "useralbums" module to actually create that..
i'm just thinkin "loudly" ;>

2.what if the user does not exist? :o
then the user should be created too,_with the right username and userid_..otherwise it's bad to have an album associated a non-existant user :o

Anyone willing to help out? ;)

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Thu, 2005-10-20 19:58

Uh, why don't you turn on the user-album-creation module, import all your users, then import their albums one user at a time into the automatically created user albums?

If you import all the users first then all the users will be there for their albums.

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Fri, 2005-10-21 02:13

true.
i've managed to do what i wanted with usage of $userName..
and then did some trick so that migration mod. is capable of getting usernames from (phpbb) embeddded installation too..

thanks.