Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Upgrading 2.3.0 rc2 to rc3 and moving to a new server


Go to End
Reply


10 Posts   2597 Views

Avatar
fishe

Community Member, 42 Posts

2 February 2009 at 1:14pm

Hi

I need to move a site to a new server, while upgrading from 2.3.0 rc2 to 2.3.0 rc3 in the process. I'm not sure of exactly how I should do this. Here is what I'm thinking...

1. backup existing site

2. install 2.3.0 rc3 on the new server - plain/vanilla install

3. copy "mysite" and "themes" directories to the new server, overwriting

4. move the database by exporting a sql/dump file from the old dB and importing this into the new dB. Using phpMySQL for both tasks.

5. possibly fix up issues relating to functions etc. different between rc2 and rc3.

Will this work? The step I'm most unsure of is the moving the database step. Also, should I be doing a /dev/build at some point?

Thanks for the help guys!

Avatar
Willr

Forum Moderator, 5513 Posts

2 February 2009 at 3:34pm

Sounds like you have a good enough idea. Just export the DB, then reimport and run /dev/build just in case and it should work fine!

Avatar
pezi5499

Community Member, 6 Posts

3 February 2009 at 10:44pm

Edited: 05/02/2009 12:28am

I am having problems Upgrading from 2.3 rc2 to rc3:

After calling dev/build I get:

Building Database

Creating database tables

PageComment
Field PageComment.CommenterURL: created as varchar(255) character set utf8 collate utf8_general_ci
Category
Club
Competition
Event
Gallery
XXXPlayerAttribute
Match
NewsArticle
Player
Referee
Team
Trainer
SiteTree
Email_BounceRecord

[User Error] Bad class to singleton() - Email_BlackList
GET /silverstripe/dev/build

Line 263 in /var/www/silverstripe/sapphire/core/Core.php

Source

254    if(($pos = strpos($className,'_')) !== false) $className = substr($className,0,$pos);
255    if($_CLASS_MANIFEST[$className]) return $_CLASS_MANIFEST[$className];
256 }
257
258 function singleton($className) {
259    static $_SINGLETONS;
260    if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
261    if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
262    if(!isset($_SINGLETONS[$className])) {
263     if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
264       $_SINGLETONS[$className] = Object::strong_create($className,null, true);
265       if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
266    }
267    return $_SINGLETONS[$className];
268 }
269

Bad class to singleton() - Email_BlackList
Line 263 of Core.php
singleton(Email_BlackList)
Line 161 of DatabaseAdmin.php
DatabaseAdmin->doBuild(,1)
Line 81 of DatabaseAdmin.php
DatabaseAdmin->build()
Line 118 of DevelopmentAdmin.php
DevelopmentAdmin->build(HTTPRequest)
Line 107 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
Controller->handleRequest(HTTPRequest)
Line 262 of Director.php
Director::handleRequest(HTTPRequest,Session)
Line 106 of Director.php
Director::direct(/dev/build)
Line 115 of main.php

Avatar
svinkle

Community Member, 16 Posts

4 February 2009 at 3:00am

I am experiencing the exact same symptoms as pezi5499. /dev/build fails with:

[User Error] Bad class to singleton() - Email_BlackList
GET /dev/build

Line 263 in /www/phpdev.realdecoy.com/svinkle/silverstripe23/svinkle/htdocs/sapphire/core/Core.php

I downloaded the tarball of rc3, extracted, and simply copied and pasted over the directories cms, jsparty, and sapphire. It seems as though the site (which is a basic vanilla test site) and the admin area are working fine. The admin footer even reports the version as 2.3.0-rc3. Not being able to build the database when needed renders any future development of this site useless.

Is there a correct method of upgrading I didn't read about?

Avatar
Willr

Forum Moderator, 5513 Posts

4 February 2009 at 10:58am

Have a read of http://doc.silverstripe.com/doku.php?id=upgrading:2.3.0

Sounds like you need to download the Newsletter module (alot of the Email*) stuff has been stripped out. Failing that do a complete code search (most texteditors will let you search multiple files) for 'Email_BlackList' and see where its lying around

Avatar
Nathan Cox

Community Member, 99 Posts

4 February 2009 at 4:12pm

I had this issue, which seemed pretty confusing given that there were no references at all to Email_BlackList in the database or filesystem. The this is, it was still in the manifest, so I fixed it by going in and manually deleting the temporary files (from c:\windows\temp\silverstripe-cache-(stuff) on windows). Not ideal but it works :)

Avatar
pezi5499

Community Member, 6 Posts

4 February 2009 at 10:59pm

Deleting the manifest-Files under /tmp (linux) solved the problem - thanks for your help!

Avatar
pezi5499

Community Member, 6 Posts

5 February 2009 at 12:37am

More problems during the upgrade to rc3:

Using a derived class of MemberLoginForm I get following error message:

[Warning] Invalid argument supplied for foreach()
GET /silverstripe/Security/login

Line 58 in /var/www/silverstripe/sapphire/forms/RequiredFields.php

Source

49
50     $result .= "</ul>";
51     return $result;
52    }
53
54    function javascript() {
55       $js = "";
56       $fields = $this->form->Fields();
57
58       foreach($this->form->Fields()->dataFields() as $field) {
59          //if the field type has some special specific specification for validation of itself
60          $validationFunc = $field->jsValidation();
61          if($validationFunc) $js .= $validationFunc . "\n";
62       }
63
64       $useLabels = $this->useLabels ? 'true' : 'false';


Trace

RequiredFields->javascript()
Line 119 of Validator.php
Validator->includeJavascriptValidation()
Line 464 of Form.php
Form->FormAttributes()
call_user_func_array(Array,Array)
Line 409 of ViewableData.php
ViewableData->XML_val(FormAttributes,,1)
Line 6 of .cache.var.www.silverstripe.themes.xxxx.templates.Includes.UserLoginForm.ss
include(/tmp/silverstripe-cache-var-www-silverstripe/.cache.var.www.silverstripe.themes.xxxx.templates.Includes.UserLoginForm.ss)
Line 350 of SSViewer.php
SSViewer->process(UserLoginForm)
Line 774 of ViewableData.php
ViewableData->renderWith(Array)
Line 13 of UserLoginForm.php
UserLoginForm->forTemplate()
Line 425 of ViewableData.php
ViewableData->XML_val(userLoginForm,,1)
Line 984 of ViewableData.php
ViewableData_Customised->XML_val(userLoginForm,,1)
Line 53 of .cache.var.www.silverstripe.themes.xxxxxxx.templates.Page.ss
include(/tmp/silverstripe-cache-var-www-silverstripe/.cache.var.www.silverstripe.themes.xxxxxxx.templates.Page.ss)
Line 350 of SSViewer.php
SSViewer->process(ViewableData_Customised)
Line 774 of ViewableData.php
ViewableData->renderWith(Array)
Line 351 of Security.php
Security->login(HTTPRequest)
Line 162 of Controller.php
Controller->handleAction(HTTPRequest)
Line 107 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
Controller->handleRequest(HTTPRequest)
Line 262 of Director.php
Director::handleRequest(HTTPRequest,Session)
Line 106 of Director.php
Director::direct(/Security/login)
Line 115 of main.php

changing line 58 from

foreach($this->form->Fields()->dataFields() as $field) {

to

foreach($this->form->Fields() as $field) {

seems to solve the Problem, but this might have side-effects later on. I do not yet have enough insight in sapphire to know how this new validator-thing works.

Anybody can help with a better solution or an explanation?

Thanks

Go to Top