combined migraration (win-linux) and upgrade (g2-g3)

bobob

Joined: 2003-07-12
Posts: 110
Posted: Sun, 2010-11-07 23:09

Hi

I have been running Gallery on a home Windows server for years now. Because I modified the code over the years, I did not upgrade often in fear of loosing the alterations I made (I don't have enough knowledge of using diff tools). G3 appears to be worth it. However, as I understand, it will not run on my Windows machine. Furthermore, I am tired of hosting my site my self, so it is time to leave the hosting to proffesionals.

Because I cannot upgrade G2 to G3 on my own server, I assume I first have to transfer my G2 to the new (linux) server, and do the upgrade there. This seems quite daunting to me. Hope some people can help me out.

I read the FAQ on how to move g2 and searched the forums. I understand that the database tables have to be altered. My Gallery version is too old for the mentioned tool, so I have to do this manually. Can anybody give me instructions of how to do this exactly? (which tables, which letters have to be changed, etc)?

Thanks


Gallery version = 2.2.4 core 1.2.0.6
PHP version = 5.2.5 apache2handler
Webserver = Apache/2.2.6 (Win32) PHP/5.2.5
Database = mysqli 5.0.45-community-nt, lock.system=database
Toolkits = Exif, LinkItemToolkit, Thumbnail, NetPBM, Gd, Ffmpeg
Acceleration = none, none
Operating system = Windows NT GALLERY 5.1 build 2600
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Rows in GalleryAccessMap table = 58
Rows in GalleryAccessSubscriberMap table = 8710
Rows in GalleryUser table = 9
Rows in GalleryItem table = 8708
Rows in GalleryAlbumItem table = 274
Rows in GalleryCacheMap table = 0

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-11-08 04:09

First upgrade to 2.3.1 on your server. FAQ: How to upgrade Gallery2?

Then follow these instructions EXACTLY:
FAQ: How can I move my gallery installation from one server to another?

BACKUP (step 1)

Take very special note of step 6 for moving from Windows to Linux.

Then importing G2 into G3 is a simple matter.

Do note, that you might still be able to install G3 successfully on your Windows box. That platform just isn't supported, but there are people doing just that. Since G3 doesn't touch a G2 install at all, you could just try it.

Either way you are still going to want to upgrade to 2.3.1

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Mon, 2010-11-08 15:08

thanks.

Is it really needed that I first upgrade G2.2.4 to 2.3.1 and then to G3? I still have the original zip file of G2.2.4. I wanted to install this on the new server. Though both servers will not have the latest G2, the versions are identical. Isn't this enough? I assume G2.2.4 can be upgraded directly to G3, or am I wrong?

Step 6 is exactly what I am worried about. How do I actually change de table titles? And how do you know what the right casing is? Should I just guess that each noun should start with a capital?

You may be right that it may be possible for me to get G3 running on my Windows server (it runs with Apache). However, is there any benefit of doing the upgrade to G3 on my own local server in stead of the new remote server?

something else, I copied g2data to a USB disk and am uploading it now to the remote server. During the copy process, a dozen files or so did not get copied for some reason (read error). All of them are in the folder g2data\cache\entity. Is this something I have to worry about?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-11-08 16:40
Quote:
Is it really needed that I first upgrade G2.2.4 to 2.3.1 and then to G3? I still have the original zip file of G2.2.4. I wanted to install this on the new server. Though both servers will not have the latest G2, the versions are identical. Isn't this enough? I assume G2.2.4 can be upgraded directly to G3, or am I wrong?

To migrate to G3, yes it's suggested to upgrade to 2.3.1. Also if you're server has PHP 5.3, 2.2.4 won't work properly anyway. The instructions I pointed to for moving to a different server is known to work and work well, if you follow the instructions exactly step-by-step. Dang near every time I've pointed someone to those instructions for moving to a different server and they've later came back because something wasn't working was because they missed (intentionally or accidentally) a step.

Quote:
Step 6 is exactly what I am worried about. How do I actually change de table titles? And how do you know what the right casing is? Should I just guess that each noun should start with a capital?

Follow the advise in that step. There is a utility you can use and download there.

Quote:
You may be right that it may be possible for me to get G3 running on my Windows server (it runs with Apache). However, is there any benefit of doing the upgrade to G3 on my own local server in stead of the new remote server?

Ease of moving to the new server :). Simply move it and the database and you should be set. Although you might still run into the capitalization issue with table names. So far I don't think anyone has migrated a G3 install from Windows to Linux to test it.

Quote:
something else, I copied g2data to a USB disk and am uploading it now to the remote server. During the copy process, a dozen files or so did not get copied for some reason (read error). All of them are in the folder g2data\cache\entity. Is this something I have to worry about?

Probably, but I'm not 100% sure. I think that is just part of the cache that gets removed when you clear G2's cache, but I'd have to test to be sure. I guess one of the steps here should probably be to clear the cache...

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Mon, 2010-11-08 16:44

You might want to consider going 2.2.4 -> 2.2.6 -> 2.3.1 to be on the safe side

--
dakanji.com

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Tue, 2010-11-09 00:07

I just now upgraded to gallery 2.3.1 on my windows box. Should I run the database-casing tool before / now or after upgrading to G3? Because G3 uses it's own tables, I do not see the use of running the tool before the upgrade to g3. Running it afterwards, I would assume it does not work with G3 tables, only G2 tables.

(I am doing all the upgrading on my windows box. Once I have got g3 working on my windows box, I will transfer it to my linux host, as recommended)

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-11-09 00:40

If you're not going to migrate G2 to Linux you won't need to run the "database-casing" tool.

Though, you might run into similar issues with G3 if migrating from Windows to Linux, you'll be the first to do that.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Tue, 2010-11-09 00:56

What I want to do is G2.2.4 -> G2.3.1 -> G3. I am now at step 2 on a Windows and have to end up on a linux host. I can a) upgrade to G3 and then transfer it to linux, or b) transfer it now, and do the upgrading on the linux host it self. As I understood your previous advice, the option a is better.

What do you mean with "you'll be the first to do that?" Do you mean the chances are small that I will run into these problems, or that you do not know many people who have done this? In case the latter, isn't it better to go for option b? This options gives me the ability to use the db-case tool. Option a does not have this possibility (ofcourse, unless you think I won't miss it because the problem will not occur).

If I do run into db casing problems if I choose for option a), can it be easily solved? It means I have to give manualy some rename commands on the mqsql prompt? How do I know which tables have to be updated to what exactly?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-11-09 01:02
Quote:
or that you do not know many people who have done this?

I know of nobody to migrate G3 from Windows to Linux. I've seen people who have moved from one Linux host to another Linux host, but not from Windows to Linux. So you might still end up with the same case-sensitivity issue for the table names. I'd have to look at the G3 table names to see if they are mix cased or not.

As for what tables to be updated, I don't know. I'd have to look at the script that fixes that issue for G2 to see exactly what it's doing to begin with.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Tue, 2010-11-09 13:23

nivekiam, I hope you can help me. I am in big trouble!

I upgraded G2.2.4 directly to G3 on my Windows box before I read your post to upgrade to G2.3.1 first. After that, however, I did this as you recommended (G2.2.4 > G.2.3.1). So now I have got two galleries running on the box; 2.3.1 and a 3.0 (the latter one is not working properly).

I wanted to re-install the 3.0 version so it can properly upgrade from 2.3.1. I thought it was best to delete the database of g3 and start fresh all over. I made a huge mistake however. I dropped the g2 database in stead of the g3 database!

Luckily I made during the upgrade from G.2.2.4 to G.2.3.1 a backup of the database (during the wizard). So now I have, a backup database of G2.2.4 (a xml file in my g2data\backups folder), a G.2.3.1 with a deleted database and a G3 which is not working properly (probably due to the direct upgrade from g2.2.4 to G3).

How can I resolve this mess? I really hope I did't screw up the pictures I have been gathering alsmost 10 years :-(

I tried searching the forum. I read something about running the db import tool at http://localhost/gallery2/lib/support/index.php?import. However, I get many errors and cannot choose a file to import from.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2010-11-09 13:40
Quote:
I upgraded G2.2.4 directly to G3 on my Windows box before I read your post to upgrade to G2.3.1 first.

Did that work? If so, don't worry about it.

Quote:
I wanted to re-install the 3.0 version so it can properly upgrade from 2.3.1. I thought it was best to delete the database of g3 and start fresh all over. I made a huge mistake however. I dropped the g2 database in stead of the g3 database!

Ouch, well is your G3 install still working? Oh I see your comment about it "not working properly" what's not working?

Quote:
Luckily I made during the upgrade from G.2.2.4 to G.2.3.1 a backup of the database (during the wizard). So now I have, a backup database of G2.2.4 (a xml file in my g2data\backups folder),

Sadly that backup is, as far as I can tell, useless. I've never been able to restore one of those XML backups successfully. That was a feature implemented in 2.3 and I'm not sure it ever worked 100%.

If you still have your g2data directory you can use the Server add option in G3 to import your photos and album structure from g2data/albums You'll lose all comments, descriptions, summaries, keywords (that aren't part of the EXIF data) users, etc. Though that xml backup might have that data, but reattaching that info is going to be a lot of work if you can't get the db import tool to import that xml.

When was your last system backup?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
bobob

Joined: 2003-07-12
Posts: 110
Posted: Tue, 2010-11-09 20:07

installing g3 worked without any error or hacks. It ran smoothly. I only had to create the database(user) by hand at the command line. The import g2.2 worked without any errors, but when it was done, only with some albums the pictures showed. Other albums seem to be missing pictures (a 'broken' image was shown for each picture).

Because I wanted to re-install G3 fresh, I deleted the G3 that was not working properly. (the gallery folder in the public_html folder). I didn't delete the database yet (because I accidently deleted the gallery 2 database in stead).

I never made a system backup (of the entire drive). I thus have a backup of public_html\gallery2, of g2data, and the xml export of the g2 database made during the upgrade.

I guess my only hope is getting the XML import to work (I have thousands of pictures, including description, tags, etc).

When I run the database import script from http://localhost/gallery2/lib/support/ I get the errors noted below. I would really appreciate very much if you could get this working for me....!

Quote:
Error (ERROR_STORAGE_FAILURE)

in D:\public_html\gallery2\modules\core\classes\GalleryStorage.class at line 239 (GalleryCoreApi::error)
in D:\public_html\gallery2\modules\core\classes\GalleryStorage.class at line 565 (GalleryStorage::_getConnection)
in D:\public_html\gallery2\modules\core\classes\GalleryCoreApi.class at line 2912 (GalleryStorage::getMapEntry)
in D:\public_html\gallery2\modules\core\classes\GallerySession.class at line 872 (GalleryCoreApi::getMapEntry)
in D:\public_html\gallery2\modules\core\classes\GallerySession.class at line 231 (GallerySession::_loadSessionData)
in D:\public_html\gallery2\modules\core\classes\Gallery.class at line 294 (GallerySession::init)
in D:\public_html\gallery2\init.inc at line 128 (Gallery::initSession)
in D:\public_html\gallery2\modules\core\classes\GalleryEmbed.class at line 99
in D:\public_html\gallery2\lib\support\import.php at line 48 (GalleryEmbed::init)
in D:\public_html\gallery2\lib\support\index.php at line 18