Koozali.org: home of the SME Server

Migrating web applications from SME 6.x to SME 7.x

Offline Salmoneus

  • *
  • 33
  • +0/-0
Migrating web applications from SME 6.x to SME 7.x
« on: May 07, 2008, 11:51:14 AM »
We have a very old server running SME 6.0.1. The only thing left on it is a few web sites that uses mysql databases.

What I want to do - if it is possible - is to move those web sites to a fresh installed SME 7 server.
If I can backup the databases and restore them on the new server, and move the content of the ibays containing the files that the web sites consist of, wouldn't that be a way of migrating to the new server?

So my question is will this work, and how do I do it? The "pre-backup" event dumps the databases all right, but just ALL databases. There might be other databases that I don't want. How do I restore the databases on the new server?

The web applications are phpnuke, osticket and phpwiki. If you have any feedback on those, please tell me. Would it be possible to install newer versions and use the old databases etc.

Any help is appreciated!

/Per


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #1 on: May 07, 2008, 02:29:27 PM »
We have a very old server running SME 6.0.1. The only thing left on it is a few web sites that uses mysql databases.

What I want to do - if it is possible - is to move those web sites to a fresh installed SME 7 server.
If I can backup the databases and restore them on the new server, and move the content of the ibays containing the files that the web sites consist of, wouldn't that be a way of migrating to the new server?

So my question is will this work, and how do I do it? The "pre-backup" event dumps the databases all right, but just ALL databases. There might be other databases that I don't want. How do I restore the databases on the new server?
Why not do a backup and a restore per server-manager? This should backup ibays as well as their databases.

The web applications are phpnuke, osticket and phpwiki. If you have any feedback on those, please tell me. Would it be possible to install newer versions and use the old databases etc.
Most likely not as on updates database layouts and field types may be updated/altered as well. You will have to dig trough the changelogs or just cross your fingers and try...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #2 on: May 07, 2008, 02:54:57 PM »
I guess I could do that. Are the different SME versions compatible when it comes to backup/restore?
What about different versions of mysql, will they be compatible?

The best thing would be if I didn't have to backup EVERYTHING on the old server, as it contains a lot of obsolete junk as well.

/Per

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #3 on: May 07, 2008, 04:14:11 PM »
I guess I could do that. Are the different SME versions compatible when it comes to backup/restore?
If you use on of the build-in options of stock SME Server and not a contribs I guess so.

What about different versions of mysql, will they be compatible?
Do not remember the exact verison of mysql on SME 6, but it might be the 3.x release which does differ from SME Server's current release, but AFAIK it is kept very much backwards compatible. For more information you should consult the MySQL manual.

The best thing would be if I didn't have to backup EVERYTHING on the old server, as it contains a lot of obsolete junk as well.
Delete anything you do not need before making a backup I would say...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #4 on: May 07, 2008, 04:18:38 PM »
I will try different ways...

Thanks for the input!

/Per

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #5 on: May 07, 2008, 05:11:33 PM »
We have a very old server running SME 6.0.1. The only thing left on it is a few web sites that uses mysql databases.

What I want to do - if it is possible - is to move those web sites to a fresh installed SME 7 server.

Why not simply upgrade your existing server to latest SME build, then transfer to new hardware using any of the the various methods available?

Darrell

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #6 on: May 08, 2008, 10:19:15 AM »
I have thought of that, but there are many (undocumented) contribs installed over the years, and it would be nice to have a fresh install with just the mentioned web applications.

I have considered a backup and restore to the same version, but to a vmware machine. That way I can make mistakes and undo them :)


Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #7 on: May 08, 2008, 10:29:57 AM »
I seem to have an issue with restoring a backup from my SME 6.0.1 to a fresh SME 7.0.3. The final file is displayed (/etc/smbpasswd), but not "restore finished" (or what ever it says in english, I use swedish locale). And even though I waited overnight and rebooted I ended up in an "inconsistent state".

EDIT: The same problem appears when I try to restore the backup to a fresh SME 6.0.1!

Any hints on that? Version incompatibility? Problems with contribs?

I have also tried to restore databases manually and moved the files to ibays with exactly the same names. That way I get "unable to connect to database" and "insufficient permissions" in another case. I guess the install scripts does some funny things with the databases...

« Last Edit: May 08, 2008, 11:27:36 AM by Salmoneus »

Offline paulsnz

  • *
  • 27
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #8 on: May 08, 2008, 11:42:36 AM »
The data based should be dumped as part of pre-backup to /home/e-smith/db/mysql/xxx.dump
Then use http://wiki.contribs.org/Phpmyadminmulti logon and import the Dbases?
Should work ?!
 :-?

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #9 on: May 08, 2008, 01:41:45 PM »
I have installed the phpmyadmin contrib (on the new machine), but when I try to restore the dump from the 6.0.1 machine on the 7.0.3 machine I get this error:


SQL-fråga:

-- MySQL dump 8.23
--
-- Host: localhost Database:
------------------------------------------------------- --
-- Server version 3.23.58
--
-- Current Database: awol
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/awol;


MySQL sa: 
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '---------------------------------------------------------
-- Server version    3.23' at line 1



Wrong mysql version?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #10 on: May 08, 2008, 07:57:37 PM »
I have installed the phpmyadmin contrib (on the new machine), but when I try to restore the dump from the 6.0.1 machine on the 7.0.3 machine I get this error:


SQL-fråga:

-- MySQL dump 8.23
--
-- Host: localhost Database:
------------------------------------------------------- --
-- Server version 3.23.58
--
-- Current Database: awol
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/awol;


MySQL sa: 
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '---------------------------------------------------------
-- Server version    3.23' at line 1



Wrong mysql version?

No, are you sure you did not mess with the dumpfile? What command are you using to import the database? Normally it should not be bothered by the header and ignore it.

It might well be that phpmyadmin will not ignore the comments and the header. The easiest thing would be to just import it as root user on the SME Server shell:

Code: [Select]
mysql < /path/to/dumpfile.sql
It might be that you will also restore the old root password which will render your database system inaccessible. This can be solved by this instruction: http://wiki.contribs.org/MySQL#Resetting_the_MySQL_root_password
« Last Edit: May 08, 2008, 08:00:32 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #11 on: May 09, 2008, 08:09:46 AM »
I will be unable to dig into this for a couple of days now, but I will let you know the results.

Thanks!


Offline byte

  • *
  • 2,183
  • +2/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #12 on: May 09, 2008, 06:54:30 PM »
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #13 on: May 20, 2008, 03:52:44 PM »
After some digging I have found out that one of the applications does NOT use mysql as I thought. Apparently it uses something called dba, and the dba handler is "gdbm" (according to the config file). When I move the application to an SME 7 box I get this error:

lib/DbaDatabase.php:42: Fatal[256]: dba_open(/home/e-smith/files/ibays/phpwiki/html/pages/wiki_pagedb.gdbm,c): No such handler: gdbm

Is gdbm not a part of SME 7? Can it be installed? Can the database be converted somehow?

/Salmoneus

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #14 on: May 20, 2008, 04:05:38 PM »
Is gdbm not a part of SME 7? Can it be installed? Can the database be converted somehow?
[/quotegdbm should be installed, you can check with:
Code: [Select]
rpm -q gdbm
lib/DbaDatabase.php:42: Fatal[256]: dba_open(/home/e-smith/files/ibays/phpwiki/html/pages/wiki_pagedb.gdbm,c): No such handler: gdbm
This seems more like a php error, I think the pear gdbm lib is not installed, perhaps this might be opf help: http://www.php.net/manual/en/ref.dbm.php
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #15 on: May 21, 2008, 07:46:18 AM »
I can confirm that gdbm IS installed, but it doesn't work.

I read the manual page, but I don't know what to look for. One part is interesting though: "you must compile PHP with dbm support by using the --with-db option". Hmm, I wouldn't want to do that in an SME system...

Is there any workaround for this? I feel I'm getting close...

/Salmoneus

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #16 on: May 23, 2008, 09:47:37 AM »
Anyone? I'm sure there is a solution to this.

Offline warren

  • *
  • 291
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #17 on: May 23, 2008, 10:27:42 AM »
I think your problem is that on 7.3,  phpinfo shows :

'--without-gdbm'


where as on sme6.0.1 :

'--with-gdbm'

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #18 on: May 23, 2008, 10:52:00 AM »
That would explain it!

Is it possible to change it? Compile PHP with the --with-gdbm option? Would that break something else in the system?


Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #19 on: May 23, 2008, 11:09:50 AM »
Another thing: The restore of the SQL databases seem to work well, but the mysql root password is changed when I restore the databases with 'mysql < mysql.dump'.

No problem with that, except that the /root/.my.cnf file content is NOT updated, not even after 'expand-template /root/.my.cnf'. I'm not sure how this works, but isn't that file supposed to contain the mysql root password?

Another thing is that database applications that already exists stops working when the root password is changed.

Am I doing something wrong here?


Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #20 on: May 23, 2008, 08:44:26 PM »
After some digging I have found out that one of the applications does NOT use mysql as I thought. Apparently it uses something called dba, and the dba handler is "gdbm" (according to the config file). When I move the application to an SME 7 box I get this error:

lib/DbaDatabase.php:42: Fatal[256]: dba_open(/home/e-smith/files/ibays/phpwiki/html/pages/wiki_pagedb.gdbm,c): No such handler: gdbm

Is gdbm not a part of SME 7? Can it be installed? Can the database be converted somehow?

/Salmoneus


From memory... so search to confirm: phpWiki uses PostgreSQL as database!

...

Offline Salmoneus

  • *
  • 33
  • +0/-0
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #21 on: May 26, 2008, 09:05:22 AM »
You CAN use mysql or postgresql, but in this case gdbm is used. Don't ask me why...

The following is a snip from the index.php file:


$DBParams = array(
   // Select the database type:
   //
   // Choose ADODB or SQL to use an SQL database with ADODB or PEAR
   // respectively (both ADODB and PEAR libraries are already included
   // with PhpWiki).
   // Choose dba to use one of the standard UNIX dbm libraries.
   // Choose file to use a flat file database.
   //'dbtype' => 'ADODB',
   //'dbtype' => 'SQL',
   'dbtype'   => 'dba',
   //'dbtype' => 'file',
   //'dbtype' => 'cvs',



   // Used by either 'dba' or 'file' and must be writable by the web
   // server If you leave this as '/tmp' you will probably lose all
   // your files eventually
   'directory'     => "/home/e-smith/files/ibays/phpwiki/html/pages",

   // choose the type of DB database file to use; most GNU systems have gdbm
   'dba_handler'   => 'gdbm',    // Either of 'gdbm' or 'db2' work great for me.
   //'dba_handler' => 'db2',
   //'dba_handler' => 'db3',    // Works fine on Windows, but not on every linux.
   //'dba_handler' => 'dbm',    // On sf.net redhat there's dbm and gdbm.
                                // dbm suffers from limits on size of data items?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #22 on: May 26, 2008, 07:26:37 PM »
Another thing: The restore of the SQL databases seem to work well, but the mysql root password is changed when I restore the databases with 'mysql < mysql.dump'.
Have a look at the FAQ in the wiki, there is a MySQL section that shows you how to reset the MySQL root password.

BTW One remark, you should only use the root account for administration and never configure applications to use it, you should configur a new user with the proper privileges for it, which should also be in the mentioned section of the FAQ.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Migrating web applications from SME 6.x to SME 7.x
« Reply #23 on: May 26, 2008, 07:46:23 PM »
That would explain it!

Is it possible to change it? Compile PHP with the --with-gdbm option? Would that break something else in the system?
It is deprecated AFAIK now, see my earlier supplied link. Since php is taken fom the upstream CentOS repos I do not think there is a easy way of recompiling it.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)