phpScheduleIt
May 24, 2013, 10:10:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1] 2
  Print  
Author Topic: Migration  (Read 1208 times)
wingoo
Full Member
***

Karma: 0
Posts: 100


« on: March 05, 2012, 08:24:18 PM »

Got the databases created manually.

Migration comes up with an error, on checking the database it has transferred the schedules over, but no resources, bookings or users.
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #1 on: March 06, 2012, 03:20:18 AM »

If anyone has any ideas how I can at least get all the resources and accessories migrated over I would be grateful. I can manually add the users and the history of reservations can remain in the old database if needed.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #2 on: March 06, 2012, 12:33:30 PM »

Here's what I would try. Open Web/install/migrate.php and change the Migrate() function (lines 164 - 175) to this

 private function Migrate()
    {
        $legacyDatabase = new Database($this->GetLegacyConnection());
        $currentDatabase = ServiceLocator::GetDatabase();

        //$this->MigrateSchedules($legacyDatabase, $currentDatabase);
        $this->MigrateResources($legacyDatabase, $currentDatabase);
        $this->MigrateAccessories($legacyDatabase, $currentDatabase);
        //$this->MigrateGroups($legacyDatabase, $currentDatabase);
        //$this->MigrateUsers($legacyDatabase, $currentDatabase);
        //$this->MigrateReservations($legacyDatabase, $currentDatabase);
    }
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #3 on: March 06, 2012, 06:51:01 PM »

Hi Nick,

Sadly no, just got the error page and no resources or accessories transferred.

I also tried commenting out the Accessories line but that did not work either Sad

There are nearly 300 resources in here (it is an equipment booking system) so I am desperate to try to get the data over rather than have to re-enter it all.

Many thanks

Wayne
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #4 on: March 06, 2012, 09:58:24 PM »

If it helps, these are screenshots of the Schedule and Resources tables.

I am wondering if something in the schedules import doesnt finish and makes it impossible to go on.

[attachment deleted by admin]
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #5 on: March 06, 2012, 10:02:48 PM »

Resources Screenshot

[attachment deleted by admin]
Logged
grassman77
Newbie
*

Karma: 0
Posts: 5


« Reply #6 on: March 07, 2012, 04:24:15 PM »

Nick,

So, commenting out the different lines and doing them one at a time worked for migrating Schedules, Accessories, Groups, and Users.  However, the first three were all empty in the first place, but I do have 18 unique users in the Users database.  Reservations and Resources still give the error.  I only have 8 different resources configured...  There seems to be a fair number of reservations, but most of them are old and unimportant.

Additionally, it does not appear as though the users' passwords were transfered over correctly, as three different logins I've tested (my own, as the admin, a test account I previously created, and a normal user) are not accepting the passwords that do work for the 1.2 version scheduler.

So, it seems like maybe we're getting somewhere, anyway.  Let me know if there's anything else I can try.  Thanks for working on this, we all appreciate it. 
Logged
oojah
Newbie
*

Karma: 0
Posts: 1


« Reply #7 on: March 08, 2012, 11:32:54 AM »

I managed to fix migration by making this change to Web/install/migrate.php

http://pastebin.com/MQYs77ts

Code:
    --- phpScheduleIt/Web/install/migrate.php       2012-02-20 10:44:52.000000000 +0000
    +++ Web/install/migrate.php     2012-03-08 14:05:55.616502448 +0000
    @@ -298,9 +299,9 @@
     
                 $newScheduleReader = $currentDatabase->Query(new AdHocCommand("select schedule_id from schedules where legacyId = \"{$row['scheduleid']}\""));
     
    -            if ($row = $newScheduleReader->GetRow())
    +            if ($srow = $newScheduleReader->GetRow())
                 {
    -                $newScheduleId = $row['schedule_id'];
    +                $newScheduleId = $srow['schedule_id'];
                 }
     
                 $minTimeSeconds = $row['minres'] * 60;

Everything migrated fine after that, although migrating the reservations themselves (~4000) was very slow.

The password encryption has also changed from using md5(password) in 1.2 to sha(password+salt) in 2.0. This is a good change, but it does mean that all of your users will need new passwords.

For reference, I managed to get useful debugging information by commenting out the SetExceptionHandler line in Pages/Page.php and changing the error_reporting() line in config/config.php to error_reporting(E_ALL).

Cheers,

Roger
Logged
grassman77
Newbie
*

Karma: 0
Posts: 5


« Reply #8 on: March 08, 2012, 01:16:53 PM »

Hey, excellent, that did the trick!  Thank you very much!
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #9 on: March 08, 2012, 06:35:05 PM »

It worked Smiley

Thank you sooooooo muuuch
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #10 on: March 12, 2012, 04:00:30 PM »

Thanks! This will be included in 2.0.2
Logged
architectspiders
Newbie
*

Karma: 0
Posts: 2


« Reply #11 on: March 13, 2012, 12:23:04 PM »

Hello,

I'm wondering if anyone would have a suggestion regarding migration.  We are running version 1.2.12 with
329 users, 10 schedules with 148 total resources. 

Many thanks
Logged
wingoo
Full Member
***

Karma: 0
Posts: 100


« Reply #12 on: March 13, 2012, 07:10:35 PM »

The above will do the trick.  The only things that may cause you drama are, the passwords will need to be reset by the users or yourself, and the descriptions (if you have entered any) of the resources dont transfer.

If you are going to use the same directory name for 2.0 as you used previously, I suggest you rename the old directory by putting an _1 after it. Then if you run into problems you can quickly reinstate your old version. I used phpscheduleit2 (I think this was the default) as my new database name to keep it seperate from my old one.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #13 on: March 19, 2012, 02:19:16 PM »

The above will do the trick.  The only things that may cause you drama are, the passwords will need to be reset by the users or yourself, and the descriptions (if you have entered any) of the resources dont transfer.

The password should be migrated the first time that user logs in to phpScheduleIt 2
Logged
ricoj1321
Newbie
*

Karma: 0
Posts: 8


« Reply #14 on: May 27, 2012, 02:19:46 PM »

The above will do the trick.  The only things that may cause you drama are, the passwords will need to be reset by the users or yourself, and the descriptions (if you have entered any) of the resources dont transfer.

If you are going to use the same directory name for 2.0 as you used previously, I suggest you rename the old directory by putting an _1 after it. Then if you run into problems you can quickly reinstate your old version. I used phpscheduleit2 (I think this was the default) as my new database name to keep it seperate from my old one.

I just installed 2.1.4 on a new host dumped the sql db from old host which has hardware failure on mobo. I have 2.1.4 running just fine on new host, dumped sql_bak into new old_db in mysql on new host. Created new phpscheduleit2 db according to instructions and all is running well.

What happens is when I go to migrate.php and try to run it against the old_db (recreation of sql_bak, all tables show just fine) I get an unknown error and nothing migrates. I have been unable to determine the issue (one sticky issue was the hostpec being 127 versus lcoalhost in config.php, for me it has to be localhost to work) Thanks!
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!