User migration
jhmac
Joined: 2009-04-18
Posts: 44 |
Posted: Thu, 2010-02-18 22:45 |
Quote:
Gallery URL = http://www.rockstarrated.com/rrgallery/main.php Sorry to post this yet again. I have found several posts on the topic but nothing about really implementing them in a beginners kind of way. I recently changed hosts (went from shared to vps) and did a fresh install of gallery 2. After uploading all the pics from the old gallery and making some graphical tweaks all I am left with is to somehow get the users from the old gallery migrated to the new one so they dont have to re-register. From the reading a simple copy of the user table wont do since the id's are used in several tables. I only have about 40 users at the moment so I dont have a problem hand coding them in except i dont think I can just copy the scrambled password info from the old database into the new one and expect it to work. Again, sorry for the reasking of the same question, just want it broken down in a more understandable format. thank you, |
|
Posts: 8339
are the users from another cms or from gallery?
what format is the data?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
From gallery.
format I'm not sure. It's whatever the default was when gallery2 was installed.
Posts: 8339
So you have a DB backup in sql or xml format? You know with your user information in it?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
well technically this site isn't live yet. Still using the other gallery install currently so the db's there are still active and I still have access to them if needed.
btw your media feed is great. I donated to gallery a couple weeks ago. You're next on my list when I build my funds back up
Posts: 8339
We really appreciate all the support
Well, we could write a script to export all necessary user info and another to create users on the other end.
But it would be nearly impossible to keep things like user comments, ratings, keywords, and even ownership of images as all the images now have new ids as well.
If your old gallery is still working, why not migrate the whole thing?
http://codex.gallery2.org/Gallery2:FAQ#How_can_I_move_my_gallery_installation_from_one_server_to_another.3F
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
I only have maybe 7 comments anyways. Ratings haven't really been used either and the only owners of the photos are pretty much myself and the photographer so I don't have any issues losing that information. I just dont want to make the 40 people registered already have to reregister.
When I first came across gallery I was pretty much only in the know how with html coding. I didn't really get into php and related code until the gallery stuff where I began kind of teaching myself the basics. The changes I made to the files and themes were made directly, not in a separate folder like gallery had suggested. It's been a year since then and my understanding of the code has increased dramatically (still learning though) so I wanted to do a fresh install and actually make the changes properly as to not affect anything else in the other folders. I've also taken better notes on the changes I made this time as opposed to last time.
Posts: 44
Played around with phpmyadmin stuff. downloaded the user table in sql format. I did attempt an insert using that data but when I went to look at the users on the site I got an error so I assume there was another table I might have missed. Went back and deleted all the rows I added and the user section came up without an error. I would be interested in the script to add, just not sure which tables are interconnected with the users. Next step/idea?
Posts: 8339
I can write something for ya... prolly take a few hours.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
That would be cool. I do know some basic sql (inserting, updating, altering, etc). Is that what you were thinking as far as the writing. I don't want to waste your time as I'm pretty sure you have your hands full with others. It's mainly the db tables that I'm not sure need updating. Your call, I'll definately accept the scripting and will owe you guys for it
Posts: 8339
Ooops! almost forgot about ya.
upload a copy to both sites yoursite.com/gallery2/g2_user_import.php
so the script should be next to your gallery's embed.php and main.php
on the site to export visit the page and copy the whole output - should be something like:
$importUsers = Array(......
on the site you're importing to:
replace the second line: $importUsers = Array(); with the output from the other.
visit that page with your browser once.
done.
Let me know if it works ok.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
Oh and make sure you backup the receiving DB first.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
Just want to make sure. This won't delete the users from the old gallery right? It will just import their information correct.
Posts: 44
Parse error: syntax error, unexpected '[', expecting ')' in /home/rocks26/public_html/rrgallery/g2_user_import.php on line 2
Posts: 8339
did you replace the whole 2nd line with the whole output from the first script?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
yessir. I will copy and paste and try again to make sure. Just wasn't sure if I should attempt again since you had said to refresh only once.
EDIT: Just copied and pasted the code again. same message.
Posts: 8339
pm me the url for both sites
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
sent
Posts: 8339
http://yoursite.com/Gallery2/gallery2/g2_user_import.php
Forbidden
You don't have permission to access /Gallery2/gallery2/g2_user_import.php on this server.
Yeah, that does not help me at all - wasting my time.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
Sorry. I had commented on that in the PM. didn't want to expose peoples emails to the world so I temporarily cut off permissions. I changed the permissions back to what they were if you want to take another peek.
Posts: 8339
Ok, I updated the above script, you'll have to re-copy and follow the steps.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
Parse error: syntax error, unexpected T_FUNCTION in /home/rocks26/public_html/rrgallery/g2_user_import.php on line 4
Posts: 8339
oops, remove the "Done" at the end of the copied output.
Was restarting my server and did not have somewhere to test.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 44
Success!! It did import all of the users along with the info. It didn't seem to take to the passwords though as my password I used on the other site didn't work. As long as the users have been imported I am ok with that. Since I'm not sure if it was just my password that didn't stick, I'll assume the other users can try and if not just use the recovery feature to reset it (which I tested and worked).
Thank you for your patience and help there super. Much appreciated and your mediablock package is the next donation on my list
Posts: 8339
I updated the script attached above to remove the "Done" at the end.
I'm glad it worked for you.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2