I screwed up my G2 install when I was upgrading. I usually move my old install then un-tar a current from Jesse's site then copy my old .htaccess and config.php over. Well being that it's too dang late I deleted my old G2 directory instead of moving it and lost my .htaccess and config.php files. So I went to reinstall G2.
It didn't like me having existing data in my DB at step 7 so I tediously deleted my G2data directories (leaving my ablums directory) using cleanup.php.... And created a new DB. I also backed up my existing DB before creating a new one.
I still have all of my images there in the albums directory. Is it possible to add the backed up tables from my old DB to the new one and get everything back?
Thanks. Not a big deal if I can't as I can recreate what little I had up there. And I understand this isn't a released product yet. It would be nice if the installer didn't bomb out at step 7 if you try to use an existing DB.
Posts: 32509
- your upgrade procedure seems fine, copying config.php and .htaccess to the new folder
- losing .htaccess shouldn't be too important
- losing config.php could have been fixed by going to the installer until the step where it creates the config.php, then abort and start the upgrader
- when you try installing with an existing DB / g2data, it only works if the existing db&g2data is in the same G2 core version as the software itself.
to your question:
if you still have a complete backup of your old g2data folder and a backup of the database, you can just upgrade. i.e. empty your current G2 db which is from a fresh install, use the installer until the write config.php step to create a config file and then enter the upgrader.
if that's not the case, no: there is no import tool to import data from an old / existing G2 installation to another G2 installation.
Posts: 8601
even if you have only the albums dir you may be able to upgrade, IF you can recreate a valid versions.dat in your g2data dir so the upgrader knows what version to upgrade from..
Posts: 16504
DOH! I knew I should've asked here first before just doing it....
Ahhhh, thanks for the info. I'll remember that.
Oh, I didn't backup the complete g2data folder. I just have my old 'albums' folder. Should I be able to import my backup of my old DB into my new DB, either from the command line or MyPHPAdmin, or would I be running into the issue of not having the same core version for the DB and what's insalled? I should be able to grab the same version I had from Jesse's site since it was only a few days old.
At least I've learned a lot more about G2. It's always amazing at how much you can learn when you screw something up :D
Posts: 16504
Thanks for the info 'mindless'. Looks like I've got some trial and error work to do tonight.
Posts: 8601
select g_parameterValue from g2_PluginParameterMap where g_pluginId='core' and g_parameterName='_version';
then make a versions.dat with:
{that version}
2.0-beta-2+
preferably write the file using a php file so it is owned by webserver/php user.. otherwise give it 666 permissions so the upgrader can rewrite it.
Posts: 16504
Thanks for the help guys. But after banging my head against the wall for a couple hours and getting a few more errors, I gave up.
I've just started over and have a fresh install. I'll be re-uploading my pics over the next day or so. I didn't have a ton of stuff, so it's not that hard to do.
I'll be a little more cautious in what I try to clean out next time....