Dear all
I spend 5 hours today with a friend trying to move an existing SS website to another server. We are doing that because the person who originally developed the website suggested that the reason why we couldn't update it (a dev/build?.... ruins the layout) was maybe because something was wrong with the server it is on at the moment. So we are trying another server on which we have full control.
Now we read quite a few posts on this forum and we followed the rules clearly:
* start a new/fresh SS install. That works
* create new SQL database and import the old one (data) to the new one (it works we checked with phpMyAdmin)
* copied other the modules from the old website (multiselectfield, dataobject_manager, sfwupload and syntaxhl), we also copied themes, assets and mysites.
* we updated the config.php file
<?php
global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => "xxxx",
"username" => "xxxx",
"password" => "xxxx",
"database" => "xxxx",
);
Security::setDefaultAdmin('admin','xxxxx');
MySQLDatabase::set_connection_charset('utf8');
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
'mywebsiteonnewserver.com'
));
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/themes/
SSViewer::set_theme('OURTHEME');
Object::add_extension('SiteConfig', 'CustomSiteConfig');
HtmlEditorConfig::get('cms')->setOption('convert_fonts_to_spans', false);
HtmlEditorConfig::get('cms')->enablePlugins("searchreplace");
HtmlEditorConfig::get('cms')->enablePlugins('syntaxhl');
HtmlEditorConfig::get('cms')->insertButtonsAfter('pasteword', 'syntaxhl');
HtmlEditorConfig::get('cms')->setOption('remove_linebreaks', false);
// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();
//Enable Search
FulltextSearchable::enable();
//Make a data objects sortable (for DOM)
SortableDataObject::add_sortable_classes(array(
'MarketingBlock',
'ShowcaseSlide',
'FAQ'
));
//Unset cache if flushing
if (isset($_GET['flush'])) {
SS_Cache::set_cache_lifetime('any', -1, 100);
}
?>
So we think we have done everything correctly. Then we have done a dev/build?flush=all and the command seemed to run correctly no error. However no matter what we do when we look at the website we seem to be loading a default HOME page not our HOME webpage ????? We just don't know why. We noticed that in the config.php file there's a CustomSiteConfig. When we put that on we can't have access to the admin section anymore. Does anyone know why ?
Anyway we are stuck and we lost 5 hours on something that seems or should be fairly simple... ???? If anyone could help us with that it would be great.
PS when we look at the LOGs we have the following message:
PHP Fatal error:
Call to a member function absoluteLink() on a non-object in /srv/www/xxxxx.com/public_html/mysite/code/Decorators/CustomSiteConfig.php on line 35
Line 35 contains this: $fields->addFieldToTab("Root.Main", new LiteralField("", '<h3 style="padding-top:20px;">IPN URL: <a href="' . DataObject::get_one('IPNPage')->absoluteLink() . '">' . DataObject::get_one('IPNPage')->absoluteLink() . '<a></h3>'));
PS2: should also say that website was developed with SS 2.4.0-rc1 and that the one that we are using on the new server is 2.4.5 so can it be a version conflict problem ?
Cheers