Forum

Questions and discussions

Restore database from older version of the script

Any questions about installation and updates

Restore database from older version of the script

Postby serge » Thu Nov 29, 2012 6:02 am

Hi all,

In the past I was running version 10.04. Today I installed a fresh new v12.10 (full install) and would like to import my old data into it.
I can see that databases are slightly different: 12.10 has new tables that didn't exist in 10.04 and some tables that did exist in 10.04 do not exist anymore in 12.10, also I presume that tables that exist in both versions may actually be different so I will run into problems if I overwrite them.
How can I safely import the data from my old 10.04 script into the new 12.10 database?
Using PHPmyAdmin I tried to export the old one and import it into the new one but I had sql error saying that "table xxx already exist". I guess I need to perform some kind of "merging" in order to import my data without messing the new database.

Thank you very much for your help!
serge
 
Posts: 81
Joined: Wed May 05, 2010 9:10 pm

Re: Restore database from older version of the script

Postby admin » Fri Nov 30, 2012 8:35 am

You should upgrade 10.04 to 10.07 first.
Then to 10.11 -> 11.03 -> 11.07 -> 11.11 -> 12.05 -> 12.06.

This is the SINGLE way.

It is impossible to use old database in the new version because the database was changed dramatically.
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Re: Restore database from older version of the script

Postby serge » Fri Nov 30, 2012 5:06 pm

Thank you for the prompt reply, Anton!

Congratulation for the great work. I had not used the script since v.10.04 and I'm just amazed to see many featured I was hoping at that time are now included in version 12.10. This is so great! Thank you so much!

Now about my issue: I did want to import my previous data in order to start over with a fresh new v.12.10 script and then start over all my PHP customization.
What I did is I upgraded my old site step by step (only applied the "update.php" at each step, didn't care about the core files). The only odd thing is that I could not do the mysql dump from the 12_05 upgrade (phpmyadmin returned an error).
Then I replaced script v.12 database with the one I had just upgraded, and copied all my photo folders from the old site to the new one ("content" folder").

The new site works perfect except one thing as far as I can see:
in my old site I had 2 license types: Commercial and Editorial. Now all my photos are marked as Commercial even though I can see that both license types are still there in the new v.12.10 site (Admin>Settings>License).
I added prices to the Editorial license (using setting "Add to All publications") but that didn't help. Note that if I upload a new photo and tick the Editorial checkbox, it is recorded as Editorial.
Is there anything I can do other than editing all my 3 thousand photos? Could this have anything to do with the dump.sql I couldn't apply when I upgraded to 12.05?

One more thing: I don't know if I messed things up or what but when I upload an Editorial photo, then the photo page states "Editorial photo can not be used for commercial purposes", wich proves that photo is well marked as "Editorial' by the script, but visitors have the ability to tick the "Commercial" radio button (it is even ticked by default) and buy it as "Commercial". The visitors should not be able to do this, the Commercial radio button should be hidden or greyed out in my opinion.

Thank you again for your help!
serge
 
Posts: 81
Joined: Wed May 05, 2010 9:10 pm

Re: Restore database from older version of the script

Postby serge » Sat Dec 01, 2012 9:50 am

I was thinking about my license issue and things are more clear to me now:
Firstly I think the "License" type in the script is not intended to differenciate between "Commercial" and "Editorial" photos. Rather it's there to differentiate "Standard" from "Extended" use.

In the past (in v10.04) I had created what the administration page calls "license types" to differenciate between Editorial and Commercial photos. And to sell Extended Rights photos, I had added "Photo Sizes" with higher prices.
Now basically I'm looking for a solution so the photos that had the Editorial license type in my old site will be marked as Editorial in my new v12.10 site.
If this is not feasible I would like at least to be able to quickly locate the Editorial photos in my old site so I can mark them one by one in the new site. Unfortunately there is no search feature in the frontend and performing a search in the backend (Admin>Catalog>Search button) doesn't work: I'm filling the license field with "editorial" and the script returns all the photos of the catalog.

Could someone help me with this?

Now I think this would be helpfull to some of you:
There is a bit of confusion when it comes to license types. We already discussed this in this topic: viewtopic.php?f=16&t=141

Here is a reminder that may help beginners:
AFAIK there are 3 different things that many of us call "License" and this is the reason why things are a bit confused:

1. a photo (this applies to sounds or movies of course) can be sold as "Royalty-Free" (you pay a flat price and then print it as you wish) or "Rights Managed" (you pay a price depending on how many prints you'll make, what size you'll print it,...)
2. a Royalty-Free photo can be sold as "for Standard use" or "for Extendend use". Standard and Extended right vary depending on the vendor but basically "Extended" means more usage allowed (more prints, multiseat,...)
3. a photo can be sold as "For Editorial Use" (only to illustrate a text in a newspaper, an article in a blog,...) or "For Commercial use" (almost any usage)

Whatever you call those 3 things (licence, rights or whatever) you must not mix them and have separate fields in your database.
serge
 
Posts: 81
Joined: Wed May 05, 2010 9:10 pm

Re: Restore database from older version of the script

Postby serge » Sat Dec 01, 2012 8:15 pm

Hi guy, it's me again. Figured out a way to locate the Editorial photos in my old site:
Using phpMyAdmin I clicked on the "photos" table from the left column. Then clicked the "Search" button. Then I selected only the "id_parent" field. In the lower part of the page, in "query by example" I filled the "license" row to read "licence=editorial". Then clicked "go" at the bottom of page. Finally I exported the result to a text file.
Now I have a text files containing all the IDs of my editorial photos.
I will have to mark as Editorial 500 photos in my new site. Not easy but feasible. If someone knows how to do this automatically please let me know. Thanks!
serge
 
Posts: 81
Joined: Wed May 05, 2010 9:10 pm

Re: Restore database from older version of the script

Postby admin » Mon Dec 03, 2012 8:19 am

The license is only a category of the price in the script:
Admin panel -> Settings -> Prices -> Photos

You can name the licenses as you want. I understand that the licenses differ dramatically.
That's why a new property 'Editorial' was added in 12.05 version.
Admin panel -> Catalog -> Edit a photo

For example You can create 2 licenses: Standart and Extended here:
Admin panel -> Settings - > Licenses

and add prices for the licenses:
Admin panel -> Settings -> Prices -> Photos

You should not add a special license for 'Editorial' photos.
You have to enable 'Editorial' checkbox here:
Admin panel -> Catalog -> Edit a photo



The table 'photos' has 'editorial' (int) field.
You can use the sql command to make photo editorial:
Code: Select all
update photos set editorial=1 where id_parent = ...
admin
Site Admin
 
Posts: 1465
Joined: Sun Mar 07, 2010 5:55 pm

Re: Restore database from older version of the script

Postby serge » Mon Dec 03, 2012 10:27 am

You are great! I changed 506 photos to "Editorial" in 2 min.
We're very lucky all cmsaccount users to get such help and support from you,
Thanks again.
serge
 
Posts: 81
Joined: Wed May 05, 2010 9:10 pm


Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests

cron
  Photo Store Script

Professional php photo stock script and WordPress plug-in for photographers and video producers.

  Support
  CMSaccount Inc.