Announcement


Notice: Undefined offset: 394 in /var/www/piwigo.org/forum/include/parser.php on line 509

Notice: Undefined offset: 394 in /var/www/piwigo.org/forum/include/parser.php on line 510

#1 2010-05-18 12:57:28

nicolas
Former Piwigo Team
2004-12-30
1232

Database migration

Hi all,

piwigo release 2.1 is compatible with SQLite and PostgreSQL database and of course Mysql. If you upgrade Piwigo from an older version but want to test or use theses database engines, the plugin Database Migration will help you migrate from mysql to SQLite or PostgreSQL.

The plugin will :
- generate new configuration file for your new database
- dump content of all tables
- create tables in your new database (For PostgreSQL, you must create database first)
- import content in the new database
- migrate to the new database

If for any reason you want to go back to mysql, the plugin can also help you.

[extension by ]

Edit
Update link

Last edited by ddtddt (2010-05-18 13:10:36)

Offline

 

#2 2010-05-22 16:15:42

duke
Translation Team
Vienna
2009-10-19
20

Re: Database migration

hi,

i tried the plugin today and failed. when i click the submit button on the import page nothing happens.
apache logs this error:

Code:

[Sat May 22 16:01:30 2010] [error] [client xx.xx.xx.xx] PHP Warning:  pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR:  syntax error at or near &quot;EXISTS&quot; at character 15 in /var/www/www.example.com/gallery/include/dblayer/functions_pgsql.inc.php on line 122, referer: http://www.example.com/gallery/admin.php?page=plugin&section=database_migration%2Fadmin.php&tab=import

any idea?

bye,
duke.

Offline

 

#3 2010-05-22 22:43:35

nicolas
Former Piwigo Team
2004-12-30
1232

Re: Database migration

duke wrote:

hi,

i tried the plugin today and failed. when i click the submit button on the import page nothing happens.
apache logs this error:

Code:

[Sat May 22 16:01:30 2010] [error] [client xx.xx.xx.xx] PHP Warning:  pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR:  syntax error at or near &quot;EXISTS&quot; at character 15 in /var/www/www.example.com/gallery/include/dblayer/functions_pgsql.inc.php on line 122, referer: http://www.example.com/gallery/admin.php?page=plugin&section=database_migration%2Fadmin.php&tab=import

any idea?

bye,
duke.

Stange. That message would say that you don't have posgresql extension for php. Do you see postgresql extension in a phpinfo() ?

Offline

 

#4 2010-05-22 23:06:57

duke
Translation Team
Vienna
2009-10-19
20

Re: Database migration

nicolas wrote:

Stange. That message would say that you don't have posgresql extension for php. Do you see postgresql extension in a phpinfo() ?

yup, it has to be, coz i'm running phpBB with postgres :)

i digged a little deeper now and found the problem, it's the db version i'm running. it seems i need at least postgres 8.3 to run
piwigo, but i still got 8.1 installed.

so next task for me: upgrade postgres, hell yeah :)

duke.

Offline

 

#5 2010-05-23 21:00:27

nicolas
Former Piwigo Team
2004-12-30
1232

Re: Database migration

duke wrote:

nicolas wrote:

Stange. That message would say that you don't have posgresql extension for php. Do you see postgresql extension in a phpinfo() ?

yup, it has to be, coz i'm running phpBB with postgres :)

i digged a little deeper now and found the problem, it's the db version i'm running. it seems i need at least postgres 8.3 to run
piwigo, but i still got 8.1 installed.

so next task for me: upgrade postgres, hell yeah :)

duke.

I didn't test with postgresql 8.1 but I think it should be ok. The needed version must be at least 8.0. So it's not the problem.

Did you have the native posgresql support or the pdo driver for postgresql ? I only add support for native one. But I could add the pdo one easily if you need it !

Offline

 

#6 2010-05-24 11:10:08

duke
Translation Team
Vienna
2009-10-19
20

Re: Database migration

nicolas wrote:

I didn't test with postgresql 8.1 but I think it should be ok. The needed version must be at least 8.0. So it's not the problem.

the problems i encountered were raised by piwigo_structure-pgsql.sql:

Code:

DROP TABLE IF EXISTS piwigo_caddie;

IF EXISTS is available since postgres 8.2

Code:

CREATE TYPE CATEGORIES_STATUS AS ENUM('public', 'private');

the ENUM type was introduced with postgres 8.3.

i can easily remove the IF EXISTS options to CREATE TABLE, because i'm deploying a new db.
but i guess piwigo needs the the ENUMs, doesn't it?

nicolas wrote:

Did you have the native posgresql support or the pdo driver for postgresql ? I only add support for native one. But I could add the pdo one easily if you need it !

i use the pdo driver. should i switch to the native one for piwigo?

bye,
duke.

Offline

 

#7 2010-05-26 21:11:42

nicolas
Former Piwigo Team
2004-12-30
1232

Re: Database migration

Sorry I didn't see your answer. :-(

duke wrote:

nicolas wrote:

I didn't test with postgresql 8.1 but I think it should be ok. The needed version must be at least 8.0. So it's not the problem.

the problems i encountered were raised by piwigo_structure-pgsql.sql:

Code:

DROP TABLE IF EXISTS piwigo_caddie;

IF EXISTS is available since postgres 8.2

Code:

CREATE TYPE CATEGORIES_STATUS AS ENUM('public', 'private');

the ENUM type was introduced with postgres 8.3.

Thanks for the report. I think I will have to change needed version !

duke wrote:

i can easily remove the IF EXISTS options to CREATE TABLE, because i'm deploying a new db.
but i guess piwigo needs the the ENUMs, doesn't it?

Yes they are mandatory.

duke wrote:

nicolas wrote:

Did you have the native posgresql support or the pdo driver for postgresql ? I only add support for native one. But I could add the pdo one easily if you need it !

i use the pdo driver. should i switch to the native one for piwigo?

I only wrote code for native extension but the pdo driver one is not so difficult to write. If you want it I can write it. Just say it !

Offline

 

#8 2010-05-30 11:02:37

duke
Translation Team
Vienna
2009-10-19
20

Re: Database migration

nicolas wrote:

Thanks for the report.

you're welcome, i'm glad that i can help :)

nicolas wrote:

I only wrote code for native extension but the pdo driver one is not so difficult to write. If you want it I can write it. Just say it !

sure, that would be great :)

thx,
duke.

Offline

 

#9 2010-05-30 12:56:06

nicolas
Former Piwigo Team
2004-12-30
1232

Re: Database migration

duke wrote:

nicolas wrote:

I only wrote code for native extension but the pdo driver one is not so difficult to write. If you want it I can write it. Just say it !

sure, that would be great :)

I just created [Bugtracker] ticket 1708. Just need to add code now !

Offline

 

#10 2010-05-30 22:24:21

tosca
Former Piwigo Team
Cévennes (France)
2006-09-23
567

Re: Database migration

nicolas wrote:

I just created [Bugtracker] ticket 1708. Just need to add code now !

Well ... I guess the most difficult is done ;-)


My galleries : Photos, Watercolours, Recipes

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact